Skip to content

Instantly share code, notes, and snippets.

@cig0
Forked from maemual/virtualenv
Created September 2, 2018 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cig0/ce4fbe080392c466ec8460fbf74284a8 to your computer and use it in GitHub Desktop.
Save cig0/ce4fbe080392c466ec8460fbf74284a8 to your computer and use it in GitHub Desktop.
golang virtualenv
export GOPATH="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"
export OLDPS1=$PS1
export PS1="[go:$(basename $GOPATH)] $PS1"
alias gcd="cd $GOPATH"
deactivate() {
export PS1=$OLDPS1
unset GOPATH
unset OLDPS1
unalias gcd
unset deactivate
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment