Files
linux-workspace/rc.local/go-env.sh.skip
2024-09-01 08:26:14 +02:00

20 lines
373 B
Plaintext

# Use user defined Go version
# GOPATH and GOROOT must be already set in $HOME/.bashrc
_GO_BIN_DIR="$HOME/go/bin"
if [[ -d "$_GO_BIN_DIR"]]; then
prepend_path_try "$_GO_BIN_DIR"
if can_run go; then
export GOROOT=$(go env GOROOT)
fi
fi
if [[ ! -z "$GOPATH" ]]; then
prepend_path "$GOPATH/bin"
fi
if [[ ! -z "$GOROOT" ]]; then
prepend_path "$GOROOT/bin"
fi