Add $GOPATH/bin to $PATH

This commit is contained in:
Anthony Rose 2021-07-02 23:12:25 +01:00
parent 11cc4430e6
commit 983bcaa3a1

View file

@ -112,10 +112,10 @@ then
fi fi
# Set up Go. # Set up Go.
export GOPROXY=https://proxy.golang.org
export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go"
if [ -x "$HOME/opt/go/bin/go" ] || [ -x /usr/bin/go ] || [ -x /usr/local/bin/go ] if [ -x "$HOME/opt/go/bin/go" ] || [ -x /usr/bin/go ] || [ -x /usr/local/bin/go ]
then then
export GOPROXY=https://proxy.golang.org
export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go"
if [ ! -d "$GOPATH" ] if [ ! -d "$GOPATH" ]
then then
mkdir -p "$GOPATH/bin" mkdir -p "$GOPATH/bin"
@ -127,6 +127,7 @@ then
export GOROOT="$HOME/opt/go" export GOROOT="$HOME/opt/go"
_acp_add_path "$GOROOT/bin" _acp_add_path "$GOROOT/bin"
fi fi
_acp_add_path "$GOPATH/bin"
fi fi
# Useful aliases for Podman and Docker # Useful aliases for Podman and Docker