#!/usr/bin/env bash

# Set up Go paths
export GOPATH="$HOME/go"
export GOROOT="/usr/local/opt/go/libexec"
add-path "$GOPATH/bin" "$GOROOT/bin"

#!/usr/bin/env bash

# Set up Go paths

for goroot in /usr/local/go /usr/local/opt/go/libexec; do
	if [ -d "$goroot" ]; then
		export GOROOT="$goroot"
		add-path "$GOROOT/bin"
		break
	fi
done

export GOPATH="$HOME/go"
add-path "$GOPATH/bin" "$GOROOT/bin"

Set GOROOT depending on which of the likely two paths exists.
Set GOROOT depending on which of the likely two paths exists.
