diff --git a/Makefile b/Makefile index 1e2f9c383..8f253c58d 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ VERSION := $(shell sh -c 'git describe --always --tags') build: prepare $(GOPATH)/bin/godep go build -o telegraf -ldflags \ - "-X main.Version $(VERSION)" \ + "-X main.Version=$(VERSION)" \ ./cmd/telegraf/telegraf.go prepare: diff --git a/circle-test.sh b/circle-test.sh index 0d344464c..36d277982 100755 --- a/circle-test.sh +++ b/circle-test.sh @@ -25,7 +25,7 @@ function exit_if_fail { function build { echo -n "=> $1-$2: " GOOS=$1 GOARCH=$2 godep go build -o telegraf-$1-$2 \ - -ldflags "-X main.Version $3" \ + -ldflags "-X main.Version=$3" \ ./cmd/telegraf/telegraf.go du -h telegraf-$1-$2 } diff --git a/cmd/telegraf/telegraf.go b/cmd/telegraf/telegraf.go index c6dd73d9c..07a61146d 100644 --- a/cmd/telegraf/telegraf.go +++ b/cmd/telegraf/telegraf.go @@ -22,7 +22,7 @@ var fPidfile = flag.String("pidfile", "", "file to write our pid to") var fPLuginsFilter = flag.String("filter", "", "filter the plugins to enable, separator is :") // Telegraf version -// -ldflags "-X main.Version `git describe --always --tags`" +// -ldflags "-X main.Version=`git describe --always --tags`" var Version string func main() { diff --git a/package.sh b/package.sh index 57a96d251..df505fa97 100755 --- a/package.sh +++ b/package.sh @@ -141,7 +141,7 @@ do_build() { rm -f $GOPATH_INSTALL/bin/$b done - godep go install -a -ldflags="-X main.Version $version" ./... + godep go install -a -ldflags="-X main.Version=$version" ./... if [ $? -ne 0 ]; then echo "Build failed, unable to create package -- aborting" cleanup_exit 1