Skip to content
Open
12 changes: 4 additions & 8 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,12 @@ benchmark:
.PHONY: fmt
fmt: common/gofmt common/goimports common/gofumpt

# `modernize' cannot be installed as a Go tool via `go get -tool'.
#
# See [1] for more details.
#
# [1]: https://github.com/golang/go/issues/73279
.PHONY: modernize
modernize:
$(GOCMD) run \
golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest \
-fix -test -v ./...
$(GO_TOOL) modernize \
-fix -test -v -any -bloop -fmtappendf -forvar -mapsloop -minmax -newexpr -omitzero -plusbuild \
-rangeint -reflecttypefor -slicescontains -slicessort -stditerators -stringscut \
-stringscutprefix -stringsseq -stringsbuilder -testingcontext -waitgroup ./...

.PHONY: tidy
tidy:
Expand Down
1 change: 1 addition & 0 deletions internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ tool (
go.opentelemetry.io/build-tools/multimod
golang.org/x/exp/cmd/apidiff
golang.org/x/tools/cmd/goimports
golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize
golang.org/x/vuln/cmd/govulncheck
gotest.tools/gotestsum
mvdan.cc/gofumpt
Expand Down
Loading