add multiple path support to go plugin

pull/1267/head
cornfeedhobo 2018-11-09 18:55:19 -05:00
parent 164f287e70
commit 4ff305c009
No known key found for this signature in database
GPG Key ID: 724357093F994B26
1 changed files with 12 additions and 1 deletions

View File

@ -5,7 +5,18 @@ about-plugin 'go environment variables & path configuration'
[ ! command -v go &>/dev/null ] && return
function _split_path_reverse() {
local r=
for p in ${@//:/ } ; do
r="$p $r"
done
echo "$r"
}
export GOROOT=${GOROOT:-$(go env GOROOT)}
pathmunge "${GOROOT}/bin"
export GOPATH=${GOPATH:-$(go env GOPATH)}
pathmunge "${GOPATH}/bin"
for p in $( _split_path_reverse ${GOPATH} ) ; do
pathmunge "${p}/bin"
done