mirror of
https://github.com/securego/gosec.git
synced 2024-12-24 11:35:52 +00:00
Check go version when running govulncheck
govulncheck supports only go 1.18 or greater. Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
This commit is contained in:
parent
84f6424ac9
commit
88c23deb88
1 changed files with 5 additions and 1 deletions
6
Makefile
6
Makefile
|
@ -12,6 +12,8 @@ GOBIN ?= $(GOPATH)/bin
|
|||
GOLINT ?= $(GOBIN)/golint
|
||||
GOSEC ?= $(GOBIN)/gosec
|
||||
GINKGO ?= $(GOBIN)/ginkgo
|
||||
GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
|
||||
GOVULN_MIN_VERSION = 17
|
||||
GO_VERSION = 1.18
|
||||
|
||||
default:
|
||||
|
@ -50,7 +52,9 @@ sec:
|
|||
|
||||
govulncheck: install-govulncheck
|
||||
@echo "CHECKING VULNERABILITIES"
|
||||
govulncheck ./...
|
||||
@if [ $(GO_MINOR_VERSION) -gt $(GOVULN_MIN_VERSION) ]; then \
|
||||
govulncheck ./...; \
|
||||
fi
|
||||
|
||||
test-coverage: install-test-deps
|
||||
go test -race -v -count=1 -coverprofile=coverage.out ./...
|
||||
|
|
Loading…
Reference in a new issue