Change -X main.Version <n> to -X main.Version=<n> for go1.5
This commit is contained in:
parent
601b444a60
commit
9bc39987f1
2
Makefile
2
Makefile
|
@ -3,7 +3,7 @@ VERSION := $(shell sh -c 'git describe --always --tags')
|
||||||
|
|
||||||
build: prepare
|
build: prepare
|
||||||
$(GOPATH)/bin/godep go build -o telegraf -ldflags \
|
$(GOPATH)/bin/godep go build -o telegraf -ldflags \
|
||||||
"-X main.Version $(VERSION)" \
|
"-X main.Version=$(VERSION)" \
|
||||||
./cmd/telegraf/telegraf.go
|
./cmd/telegraf/telegraf.go
|
||||||
|
|
||||||
prepare:
|
prepare:
|
||||||
|
|
|
@ -25,7 +25,7 @@ function exit_if_fail {
|
||||||
function build {
|
function build {
|
||||||
echo -n "=> $1-$2: "
|
echo -n "=> $1-$2: "
|
||||||
GOOS=$1 GOARCH=$2 godep go build -o telegraf-$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
|
./cmd/telegraf/telegraf.go
|
||||||
du -h telegraf-$1-$2
|
du -h telegraf-$1-$2
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 :")
|
var fPLuginsFilter = flag.String("filter", "", "filter the plugins to enable, separator is :")
|
||||||
|
|
||||||
// Telegraf version
|
// Telegraf version
|
||||||
// -ldflags "-X main.Version `git describe --always --tags`"
|
// -ldflags "-X main.Version=`git describe --always --tags`"
|
||||||
var Version string
|
var Version string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -141,7 +141,7 @@ do_build() {
|
||||||
rm -f $GOPATH_INSTALL/bin/$b
|
rm -f $GOPATH_INSTALL/bin/$b
|
||||||
done
|
done
|
||||||
|
|
||||||
godep go install -a -ldflags="-X main.Version $version" ./...
|
godep go install -a -ldflags="-X main.Version=$version" ./...
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Build failed, unable to create package -- aborting"
|
echo "Build failed, unable to create package -- aborting"
|
||||||
cleanup_exit 1
|
cleanup_exit 1
|
||||||
|
|
Loading…
Reference in New Issue