mirror of
https://github.com/coder/coder.git
synced 2026-06-03 13:08:25 +00:00
b116d22c5f
Go 1.24 adds [tool dependencies](https://go.dev/doc/modules/managing-dependencies#tools). This allows us to track versions of tools in our `go.mod` instead of sprinkling various `go run` commands throughout our codebase. NOTE: there are still various hard-coded `go install` commands in our dogfood Dockerfile. As that list is likely severely outdated, will leave that for a separate PR.
16 lines
362 B
Bash
Executable File
16 lines
362 B
Bash
Executable File
#!/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
|
|
|
|
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/)" "${@}"
|