From 502de11c2fa38d2a4ef86adf6ae1132d825e9400 Mon Sep 17 00:00:00 2001 From: Enze Chi Date: Thu, 18 Oct 2018 10:57:54 +1100 Subject: [PATCH] Use go binary to get default GOROOT and GOPATH --- plugins/available/go.plugin.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 plugins/available/go.plugin.bash diff --git a/plugins/available/go.plugin.bash b/plugins/available/go.plugin.bash old mode 100644 new mode 100755 index c9fcdff8..827ac388 --- a/plugins/available/go.plugin.bash +++ b/plugins/available/go.plugin.bash @@ -5,7 +5,7 @@ about-plugin 'go environment variables & path configuration' [ ! command -v go &>/dev/null ] && return -export GOROOT=${GOROOT:-$(go env | grep GOROOT | cut -d'"' -f2)} +export GOROOT=${GOROOT:-$(go env GOROOT)} pathmunge "${GOROOT}/bin" -export GOPATH=${GOPATH:-"$HOME/go"} +export GOPATH=${GOPATH:-$(go env GOPATH)} pathmunge "${GOPATH}/bin"