Skip to content

Commit

Permalink
allow building with custom Go binary
Browse files Browse the repository at this point in the history
I need to build deb packages using golang-1.10 on Ubuntu Xenial which is
present in a non-default location while /usr/bin/go is at golang-1.6.

With this commit I can simply run:
`GO=/usr/lib/go-1.10/bin/go ./build.sh`
to use golang-1.10.

Signed-off-by: Lokesh Mandvekar <[email protected]>
  • Loading branch information
lsm5 committed Mar 23, 2018
1 parent e590fca commit 9bdf37f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fi

export GO15VENDOREXPERIMENT=1
export GOPATH=${PWD}/gopath
export GO="${GO:-go}"

mkdir -p "${PWD}/bin"

Expand All @@ -27,9 +28,9 @@ for d in $PLUGINS; do
# use go install so we don't duplicate work
if [ -n "$FASTBUILD" ]
then
GOBIN=${PWD}/bin go install -pkgdir $GOPATH/pkg "$@" $REPO_PATH/$d
GOBIN=${PWD}/bin $GO install -pkgdir $GOPATH/pkg "$@" $REPO_PATH/$d
else
go build -o "${PWD}/bin/$plugin" -pkgdir "$GOPATH/pkg" "$@" "$REPO_PATH/$d"
$GO build -o "${PWD}/bin/$plugin" -pkgdir "$GOPATH/pkg" "$@" "$REPO_PATH/$d"
fi
fi
done

0 comments on commit 9bdf37f

Please sign in to comment.