Make sure GOPATH/bin is in PATH

This commit is contained in:
Tim Hockin 2017-09-01 07:39:03 -07:00
parent 7f57478345
commit 7d87eec437

View File

@ -366,13 +366,16 @@ kube::golang::setup_env() {
kube::golang::create_gopath_tree
export GOPATH=${KUBE_GOPATH}
export GOPATH="${KUBE_GOPATH}"
# Append KUBE_EXTRA_GOPATH to the GOPATH if it is defined.
if [[ -n ${KUBE_EXTRA_GOPATH:-} ]]; then
GOPATH="${GOPATH}:${KUBE_EXTRA_GOPATH}"
fi
# Make sure our own Go binaries are in PATH.
export PATH="${KUBE_GOPATH}/bin:${PATH}"
# Change directories so that we are within the GOPATH. Some tools get really
# upset if this is not true. We use a whole fake GOPATH here to collect the
# resultant binaries. Go will not let us use GOBIN with `go install` and