Use go binary to get default GOROOT and GOPATH
parent
aadba30cf9
commit
502de11c2f
|
|
@ -5,7 +5,7 @@ about-plugin 'go environment variables & path configuration'
|
||||||
|
|
||||||
[ ! command -v go &>/dev/null ] && return
|
[ ! 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"
|
pathmunge "${GOROOT}/bin"
|
||||||
export GOPATH=${GOPATH:-"$HOME/go"}
|
export GOPATH=${GOPATH:-$(go env GOPATH)}
|
||||||
pathmunge "${GOPATH}/bin"
|
pathmunge "${GOPATH}/bin"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue