Add modernize tool to Makefile

This commit is contained in:
Holger Obermaier
2026-02-24 15:38:13 +01:00
parent d639c942d5
commit b1d6388624

View File

@@ -61,7 +61,7 @@ fmt:
# gofumpt <https://github.com/mvdan/gofumpt>: # gofumpt <https://github.com/mvdan/gofumpt>:
# Enforce a stricter format than gofmt # Enforce a stricter format than gofmt
.PHONY: gofumpt .PHONY: gofumpt
fmt: gofumpt:
$(GOBIN) install mvdan.cc/gofumpt@latest $(GOBIN) install mvdan.cc/gofumpt@latest
gofumpt -w $(GOSRC_COLLECTORS) gofumpt -w $(GOSRC_COLLECTORS)
gofumpt -w $(GOSRC_SINKS) gofumpt -w $(GOSRC_SINKS)
@@ -75,6 +75,9 @@ fmt:
vet: vet:
$(GOBIN) vet ./... $(GOBIN) vet ./...
.PHONY: modernize
modernize:
$(GOBIN) run golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest ./...
# Run linter for the Go programming language. # Run linter for the Go programming language.
# Using static analysis, it finds bugs and performance issues, offers simplifications, and enforces style rules # Using static analysis, it finds bugs and performance issues, offers simplifications, and enforces style rules