Skip to content

Commit 141c786

Browse files
authored
chore: use Go 1.24 tool for staticcheck and goimports (#1191)
1 parent bc682d5 commit 141c786

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ checkformat: ## Checks that the code is formatted correctly
107107
fi
108108

109109
checkimports: ## Checks that imports are formatted correctly
110-
@@if [ -n "$$(go run golang.org/x/tools/cmd/goimports -l -d .)" ]; then \
110+
@@if [ -n "$$(go tool goimports -l -d .)" ]; then \
111111
echo "goimports check failed: run 'make format'"; \
112112
exit 1; \
113113
fi
@@ -116,14 +116,14 @@ vet: ## Runs go vet
116116
go vet ./...
117117

118118
staticcheck: ## Runs staticcheck
119-
go list ./... | grep -v 'fakes$$' | xargs go run honnef.co/go/tools/cmd/staticcheck
119+
go list ./... | grep -v 'fakes$$' | xargs go tool staticcheck
120120

121121
###### Format #################################################################
122122

123123
.PHONY: format
124124
format: ## format the source
125125
gofmt -s -e -l -w .
126-
go run golang.org/x/tools/cmd/goimports -l -w .
126+
go tool goimports -l -w .
127127

128128
###### Image ##################################################################
129129

go.mod

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ require (
2828
github.com/zclconf/go-cty v1.16.2
2929
golang.org/x/crypto v0.33.0
3030
golang.org/x/net v0.35.0
31-
golang.org/x/tools v0.30.0
3231
gopkg.in/yaml.v3 v3.0.1
3332
gorm.io/driver/mysql v1.5.7
3433
gorm.io/driver/sqlite v1.5.7
3534
gorm.io/gorm v1.25.12
36-
honnef.co/go/tools v0.6.0
3735
)
3836

3937
require (
@@ -132,6 +130,7 @@ require (
132130
golang.org/x/sys v0.30.0 // indirect
133131
golang.org/x/text v0.22.0 // indirect
134132
golang.org/x/time v0.9.0 // indirect
133+
golang.org/x/tools v0.30.0 // indirect
135134
google.golang.org/api v0.219.0 // indirect
136135
google.golang.org/genproto v0.0.0-20250127172529-29210b9bc287 // indirect
137136
google.golang.org/genproto/googleapis/api v0.0.0-20250127172529-29210b9bc287 // indirect
@@ -140,7 +139,12 @@ require (
140139
google.golang.org/protobuf v1.36.4 // indirect
141140
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0 // indirect
142141
gopkg.in/ini.v1 v1.67.0 // indirect
142+
honnef.co/go/tools v0.6.0 // indirect
143143
rsc.io/goversion v1.2.0 // indirect
144144
)
145145

146-
tool github.com/onsi/ginkgo/v2/ginkgo
146+
tool (
147+
github.com/onsi/ginkgo/v2/ginkgo
148+
golang.org/x/tools/cmd/goimports
149+
honnef.co/go/tools/cmd/staticcheck
150+
)

tools/tools.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ package tools
66
import (
77
_ "github.com/google/gops"
88
_ "github.com/maxbrunsfeld/counterfeiter/v6"
9-
_ "golang.org/x/tools/cmd/goimports"
10-
_ "honnef.co/go/tools/cmd/staticcheck"
119
)
1210

1311
// This file imports packages that are used when running go generate, or used

0 commit comments

Comments
 (0)