File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ GINKGO ?= $(GOBIN)/ginkgo
1818GO_MINOR_VERSION = $(shell $(GO ) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
1919GOVULN_MIN_VERSION = 17
2020GO_VERSION = 1.23
21+ LDFLAGS = -ldflags "\
22+ -X 'main.Version=$(shell git describe --tags --always) ' \
23+ -X 'main.GitTag=$(shell git describe --tags --abbrev=0) ' \
24+ -X 'main.BuildDate=$(shell date -u +% Y-% m-% dT% H:% M:% SZ) '"
2125
2226default :
2327 $(MAKE ) build
@@ -62,10 +66,10 @@ test-coverage: install-test-deps
6266 go test -race -v -count=1 -coverprofile=coverage.out ./...
6367
6468build :
65- go build -o $(BIN ) ./cmd/gosec/
69+ go build $( LDFLAGS ) -o $(BIN ) ./cmd/gosec/
6670
6771build-race :
68- go build -race -o $(BIN ) ./cmd/gosec/
72+ go build -race $( LDFLAGS ) -o $(BIN ) ./cmd/gosec/
6973
7074clean :
7175 rm -rf build vendor dist coverage.out
You can’t perform that action at this time.
0 commit comments