diff --git a/plugins/available/go.plugin.bash b/plugins/available/go.plugin.bash new file mode 100644 index 00000000..093c2c4c --- /dev/null +++ b/plugins/available/go.plugin.bash @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +cite about-plugin +about-plugin 'go environment variables & path configuration' + +[ ! command -v go &>/dev/null ] && return + +export GOROOT=${GOROOT:-$(go env | grep GOROOT | cut -d'"' -f2)} +pathmunge "${GOROOT}/bin" +export GOPATH=${GOPATH:-"$HOME/.go"} +pathmunge "${GOPATH}/bin"