-
-
Save szaydel/7515265 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# | |
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