From 36204ff81b649d70519c7a0dcb21ef64a66b8837 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Tue, 31 Mar 2020 06:29:03 -0400 Subject: [PATCH] constants.go: set version at compile time --- api/Makefile | 4 ++-- api/constants.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/Makefile b/api/Makefile index bb0052d..5c541a7 100644 --- a/api/Makefile +++ b/api/Makefile @@ -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 diff --git a/api/constants.go b/api/constants.go index 078febe..75ab996 100644 --- a/api/constants.go +++ b/api/constants.go @@ -1,3 +1,3 @@ package main -var version = "v1.7.0" +var version string