Demand at least go1.6

This commit is contained in:
Tim Hockin
2016-04-22 22:37:32 -07:00
parent cbf886c7f4
commit 527cb50583
8 changed files with 37 additions and 86 deletions

View File

@@ -107,18 +107,11 @@ kube::version::load_version_vars() {
source "${version_file}"
}
# 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 [[ -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}"
fi
echo "-X ${KUBE_GO_PACKAGE}/pkg/version.${key}=${val}"
}
# Prints the value that needs to be passed to the -ldflags parameter of go build