constants.go: set version at compile time

This commit is contained in:
Adhityaa Chandrasekar 2020-03-31 06:29:03 -04:00
parent f09a619d41
commit 36204ff81b
2 changed files with 3 additions and 3 deletions

View File

@ -26,11 +26,11 @@ clean:
devel-go:
GO111MODULE=on go mod vendor
GO111MODULE=on go build -mod=vendor -v -o $(GO_DEVEL_BUILD_BINARY)
GO111MODULE=on go build -mod=vendor -v -o $(GO_DEVEL_BUILD_BINARY) -ldflags "-X main.version=$(shell git describe --tags)"
prod-go:
GO111MODULE=on go mod vendor
GO111MODULE=on go build -mod=vendor -v -o $(GO_PROD_BUILD_BINARY)
GO111MODULE=on go build -mod=vendor -v -o $(GO_PROD_BUILD_BINARY) -ldflags "-X main.version=$(shell git describe --tags)"
test-go:
GO111MODULE=on go mod vendor

View File

@ -1,3 +1,3 @@
package main
var version = "v1.7.0"
var version string