Merge pull request #524 from github/go19

Moving to go1.9
This commit is contained in:
Shlomi Noach 2017-12-03 12:05:24 +02:00 committed by GitHub
commit 83416fbb19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 11 deletions

View File

@ -1,7 +1,7 @@
# http://docs.travis-ci.com/user/languages/go/ # http://docs.travis-ci.com/user/languages/go/
language: go language: go
go: 1.8 go: 1.9
os: os:
- linux - linux

View File

@ -10,6 +10,11 @@ function build {
GOOS=$3 GOOS=$3
GOARCH=$4 GOARCH=$4
if [[ $(go version | egrep "go1[.][012345678]") ]]; then
echo "go version is too low. Must use 1.9 or above"
exit 1
fi
echo "Building ${osname} binary" echo "Building ${osname} binary"
export GOOS export GOOS
export GOARCH export GOARCH
@ -27,7 +32,6 @@ buildpath=/tmp/gh-ost
target=gh-ost target=gh-ost
timestamp=$(date "+%Y%m%d%H%M%S") timestamp=$(date "+%Y%m%d%H%M%S")
ldflags="-X main.AppVersion=${RELEASE_VERSION}" ldflags="-X main.AppVersion=${RELEASE_VERSION}"
export GO15VENDOREXPERIMENT=1
mkdir -p ${buildpath} mkdir -p ${buildpath}
build macOS osx darwin amd64 build macOS osx darwin amd64

View File

@ -1,19 +1,20 @@
#!/bin/bash #!/bin/bash
GO_VERSION=go1.7 PREFERRED_GO_VERSION=go1.9.2
SUPPORTED_GO_VERSIONS='go1.[89]'
GO_PKG_DARWIN=${GO_VERSION}.darwin-amd64.pkg GO_PKG_DARWIN=${PREFERRED_GO_VERSION}.darwin-amd64.pkg
GO_PKG_DARWIN_SHA=e7089843bc7148ffcc147759985b213604d22bb9fd19bd930b515aa981bf1b22 GO_PKG_DARWIN_SHA=73fd5840d55f5566d8db6c0ffdd187577e8ebe650c783f68bd27cbf95bde6743
GO_PKG_LINUX=${GO_VERSION}.linux-amd64.tar.gz GO_PKG_LINUX=${PREFERRED_GO_VERSION}.linux-amd64.tar.gz
GO_PKG_LINUX_SHA=702ad90f705365227e902b42d91dd1a40e48ca7f67a2f4b2fd052aaa4295cd95 GO_PKG_LINUX_SHA=de874549d9a8d8d8062be05808509c09a88a248e77ec14eb77453530829ac02b
export ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" export ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
cd $ROOTDIR cd $ROOTDIR
# If Go isn't installed globally, setup environment variables for local install. # If Go isn't installed globally, setup environment variables for local install.
if [ -z "$(which go)" ] || [ -z "$(go version | grep $GO_VERSION)" ]; then if [ -z "$(which go)" ] || [ -z "$(go version | grep "$SUPPORTED_GO_VERSIONS")" ]; then
GODIR="$ROOTDIR/.vendor/go17" GODIR="$ROOTDIR/.vendor/go19"
if [ $(uname -s) = "Darwin" ]; then if [ $(uname -s) = "Darwin" ]; then
export GOROOT="$GODIR/usr/local/go" export GOROOT="$GODIR/usr/local/go"
@ -25,7 +26,7 @@ if [ -z "$(which go)" ] || [ -z "$(go version | grep $GO_VERSION)" ]; then
fi fi
# Check if local install exists, and install otherwise. # Check if local install exists, and install otherwise.
if [ -z "$(which go)" ] || [ -z "$(go version | grep $GO_VERSION)" ]; then if [ -z "$(which go)" ] || [ -z "$(go version | grep "$SUPPORTED_GO_VERSIONS")" ]; then
[ -d "$GODIR" ] && rm -rf $GODIR [ -d "$GODIR" ] && rm -rf $GODIR
mkdir -p "$GODIR" mkdir -p "$GODIR"
cd "$GODIR"; cd "$GODIR";
@ -42,7 +43,9 @@ if [ -z "$(which go)" ] || [ -z "$(go version | grep $GO_VERSION)" ]; then
fi fi
# Prove we did something right # Prove we did something right
echo "$GO_VERSION installed in $GODIR: Go Binary: $(which go)" echo "$(go version) installed in $GODIR: Go Binary: $(which go)"
else
echo "$(go version) found in $GODIR: Go Binary: $(which go)"
fi fi
cd $ROOTDIR cd $ROOTDIR