Makefile (950B)
1 GO_LINT=$(shell which golangci-lint 2> /dev/null || echo '') 2 GO_LINT_URI=github.com/golangci/golangci-lint/cmd/golangci-lint@latest 3 4 GO_SEC=$(shell which gosec 2> /dev/null || echo '') 5 GO_SEC_URI=github.com/securego/gosec/v2/cmd/gosec@latest 6 7 GO_VULNCHECK=$(shell which govulncheck 2> /dev/null || echo '') 8 GO_VULNCHECK_URI=golang.org/x/vuln/cmd/govulncheck@latest 9 10 .PHONY: golangci-lint 11 golangci-lint: 12 $(if $(GO_LINT), ,go install $(GO_LINT_URI)) 13 @echo "##### Running golangci-lint" 14 golangci-lint run -v 15 16 .PHONY: gosec 17 gosec: 18 $(if $(GO_SEC), ,go install $(GO_SEC_URI)) 19 @echo "##### Running gosec" 20 gosec ./... 21 22 .PHONY: govulncheck 23 govulncheck: 24 $(if $(GO_VULNCHECK), ,go install $(GO_VULNCHECK_URI)) 25 @echo "##### Running govulncheck" 26 govulncheck ./... 27 28 .PHONY: verify 29 verify: golangci-lint gosec govulncheck 30 31 .PHONY: test 32 test: 33 @echo "##### Running tests" 34 go test -race -cover -coverprofile=coverage.coverprofile -covermode=atomic -v ./...