diff --git a/libexec/goenv-exec b/libexec/goenv-exec index 13eda175..1811653e 100755 --- a/libexec/goenv-exec +++ b/libexec/goenv-exec @@ -34,7 +34,9 @@ for script in "${scripts[@]}"; do done shift 1 -# Go needs a GOROOT -export GOROOT="$(goenv-prefix)/" +# Go needs a GOROOT without system's Go +if [[ $GOENV_VERSION != "system" ]]; then + export GOROOT="$(goenv-prefix)/" +fi export PATH="${GOENV_BIN_PATH}:${GOROOT}/bin:${PATH}" exec -a "$GOENV_COMMAND" "$GOENV_COMMAND_PATH" "$@" diff --git a/libexec/goenv-init b/libexec/goenv-init index fe4d9857..82a1e415 100755 --- a/libexec/goenv-init +++ b/libexec/goenv-init @@ -88,12 +88,10 @@ case "$shell" in fish ) echo "set -gx PATH '${GOENV_ROOT}/shims' \$PATH" echo "set -gx GOENV_SHELL $shell" - echo "set -gx GOROOT (goenv prefix)" ;; * ) echo 'export PATH="'${GOENV_ROOT}'/shims:${PATH}"' echo "export GOENV_SHELL=$shell" - echo 'export GOROOT="$(goenv prefix)"' ;; esac