Skip to content

Instantly share code, notes, and snippets.

@szaydel
Forked from ivanzoid/setupGOROOT.sh
Last active December 28, 2015 14:29
Show Gist options
  • Save szaydel/7515265 to your computer and use it in GitHub Desktop.
Save szaydel/7515265 to your computer and use it in GitHub Desktop.
#
# Place this code to your .profile, .bashrc, .bash_profile or whatever
#
function program_exists -d "Check if program is valid"
type "$1" &> /dev/null ;
end
function setup_goroot
set GOPATH (which go)
set GODIR (dirname $GOPATH)
set GOPATH_BREW_RELATIVE (readlink $GOPATH)
set GOPATH_BREW (dirname $GOPATH_BREW_RELATIVE)
set -x GOROOT (cd $GODIR; cd $GOPATH_BREW/..; pwd)
end
setup_goroot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment