Merge pull request #22643 from eparis/go16

Auto commit by PR queue bot
This commit is contained in:
k8s-merge-robot 2016-03-07 13:29:44 -08:00
commit 76cbeb83de
3 changed files with 4 additions and 4 deletions

View File

@ -107,14 +107,14 @@ kube::version::load_version_vars() {
source "${version_file}"
}
# golang 1.5 wants `-X key=val`, but golang 1.4- REQUIRES `-X key val`
# golang 1.5+ wants `-X key=val`, but golang 1.4- REQUIRES `-X key val`
kube::version::ldflag() {
local key=${1}
local val=${2}
GO_VERSION=($(go version))
if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.5') ]]; then
if [[ -n $(echo "${GO_VERSION[2]}" | grep -E 'go1.1|go1.2|go1.3|go1.4') ]]; then
echo "-X ${KUBE_GO_PACKAGE}/pkg/version.${key} ${val}"
else
echo "-X ${KUBE_GO_PACKAGE}/pkg/version.${key}=${val}"

View File

@ -24,7 +24,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
GO_VERSION=($(go version))
if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.4|go1.5') ]]; then
if [[ -n $(echo "${GO_VERSION[2]}" | grep -E 'go1.1|go1.2|go1.3') ]]; then
echo "Unsupported go version '${GO_VERSION}', skipping gofmt."
exit 0
fi

View File

@ -24,7 +24,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
GO_VERSION=($(go version))
if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.4|go1.5') ]]; then
if [[ -n $(echo "${GO_VERSION[2]}" | grep -E 'go1.1|go1.2|go1.3') ]]; then
echo "Unsupported go version '${GO_VERSION}', skipping gofmt."
exit 0
fi