Merge pull request #1243 from ezchi/get-default-go-environment-variables-with-go-binary

Use go binary to get default GOROOT and GOPATH
pull/1246/head
Nils Winkler 2018-10-18 15:43:37 +02:00 committed by GitHub
commit 4a64dcbc6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

4
plugins/available/go.plugin.bash 100644 → 100755
View File

@ -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"