-
-
Save yetone/b18c08bdf2d455b86030 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Place this code to your .profile, .bashrc, .bash_profile or whatever | |
# | |
program_exists () { | |
type "$1" &> /dev/null ; | |
} | |
if program_exists go; then | |
function setupGOROOT() | |
{ | |
local GOPATH=`which go` | |
local GODIR=`dirname $GOPATH` | |
local GOPATH_BREW_RELATIVE=`readlink $GOPATH` | |
local GOPATH_BREW=`dirname $GOPATH_BREW_RELATIVE` | |
export GOROOT=`cd $GODIR; cd $GOPATH_BREW/..; pwd` | |
} | |
setupGOROOT | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment