diff --git a/Makefile.Common b/Makefile.Common index 9860da5f1b4..9cb594a9221 100644 --- a/Makefile.Common +++ b/Makefile.Common @@ -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: diff --git a/internal/tools/go.mod b/internal/tools/go.mod index b48d1705b18..1e8d1765344 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -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