1+ GOVERSION ?= $(shell go env GOVERSION)
2+
13# # help: 💡 Display available commands
24.PHONY : help
35help :
911audit :
1012 go mod verify
1113 go vet ./...
12- go run golang.org/x/vuln/cmd/govulncheck@latest ./...
14+ GOTOOLCHAIN= $( GOVERSION ) go run golang.org/x/vuln/cmd/govulncheck@latest ./...
1315
1416# # benchmark: 📈 Benchmark code performance
1517.PHONY : benchmark
@@ -19,13 +21,13 @@ benchmark:
1921# # coverage: ☂️ Generate coverage report
2022.PHONY : coverage
2123coverage :
22- go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=1 -coverprofile=/tmp/coverage.out -covermode=atomic
24+ GOTOOLCHAIN= $( GOVERSION ) go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=1 -coverprofile=/tmp/coverage.out -covermode=atomic
2325 go tool cover -html=/tmp/coverage.out
2426
2527# # format: 🎨 Fix code format issues
2628.PHONY : format
2729format :
28- go run mvdan.cc/gofumpt@latest -w -l .
30+ GOTOOLCHAIN= $( GOVERSION ) go run mvdan.cc/gofumpt@latest -w -l .
2931
3032# # markdown: 🎨 Find markdown format issues (Requires markdownlint-cli2)
3133.PHONY : markdown
@@ -47,17 +49,17 @@ install-lint:
4749# # modernize: 🛠 Run gopls modernize
4850.PHONY : modernize
4951modernize :
50- go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test=false ./...
52+ GOTOOLCHAIN= $( GOVERSION ) go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test=false ./...
5153
5254# # test: 🚦 Execute all tests
5355.PHONY : test
5456test :
55- go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=1 -shuffle=on
57+ GOTOOLCHAIN= $( GOVERSION ) go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=1 -shuffle=on
5658
5759# # longtest: 🚦 Execute all tests 10x
5860.PHONY : longtest
5961longtest :
60- go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=15 -shuffle=on
62+ GOTOOLCHAIN= $( GOVERSION ) go run gotest.tools/gotestsum@latest -f testname -- ./... -race -count=15 -shuffle=on
6163
6264# # tidy: 📌 Clean and tidy dependencies
6365.PHONY : tidy
6769# # betteralign: 📐 Optimize alignment of fields in structs
6870.PHONY : betteralign
6971betteralign :
70- go run github.com/dkorunic/betteralign/cmd/betteralign@latest -test_files -generated_files -apply ./...
72+ GOTOOLCHAIN= $( GOVERSION ) go run github.com/dkorunic/betteralign/cmd/betteralign@v0.7.2 -test_files -generated_files -apply ./...
7173
7274# # generate: ⚡️ Generate msgp && interface implementations
7375.PHONY : generate
0 commit comments