diff --git a/hack/config-go.sh b/hack/config-go.sh index d49b8a0688e..3904f57ed3b 100644 --- a/hack/config-go.sh +++ b/hack/config-go.sh @@ -105,8 +105,16 @@ kube::setup_go_environment() { fi fi - # Set GOPATH to point to the tree maintained by `godep`. - GOPATH="${KUBE_TARGET}:${KUBE_REPO_ROOT}/Godeps/_workspace" + GOPATH=${KUBE_TARGET} + # Append KUBE_EXTRA_GOPATH to the GOPATH if it is defined. + if [[ -n ${KUBE_EXTRA_GOPATH:-} ]]; then + GOPATH=${GOPATH}:${KUBE_EXTRA_GOPATH} + fi + # Append the tree maintained by `godep` to the GOPATH unless KUBE_NO_GODEPS + # is defined. + if [[ -z ${KUBE_NO_GODEPS:-} ]]; then + GOPATH="${GOPATH}:${KUBE_REPO_ROOT}/Godeps/_workspace" + fi export GOPATH # Unset GOBIN in case it already exists in the current session.