2026-01-08 15:36:03 +04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
# This script formats Go file(s) with our project-specific configuration.
|
|
|
|
|
|
|
|
|
|
# Usage: format_go_file <file>...
|
|
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
if [[ "$#" -lt 1 ]]; then
|
|
|
|
|
echo "Usage: $0 <file>..."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2026-01-08 16:25:28 +00:00
|
|
|
go tool mvdan.cc/gofumpt -w -l "${@}"
|
|
|
|
|
go tool github.com/daixiang0/gci write -s standard -s default -s "Prefix(github.com/coder,cdr.dev/)" "${@}"
|