Last active
September 9, 2019 08:01
-
-
Save austingebauer/5797da51432061b5f5478d4b2d031137 to your computer and use it in GitHub Desktop.
Set GOPATH, GOBIN, and PATH in current directory
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
#!/usr/bin/env bash | |
# | |
# Sets the GOPATH and GOBIN to the current directory. | |
# Adds GOBIN to the PATH. | |
# | |
# Usage: | |
# 1. Put this script somewhere on your PATH. | |
# 2. Enter directory of a golang project (contains src, pkg, bin) | |
# 3. Execute: . gopath | |
# | |
export GOPATH="`pwd`" | |
echo "GOPATH set to: ${GOPATH}" | |
export GOBIN="$GOPATH/bin" | |
echo "GOBIN set to: ${GOBIN}" | |
export PATH="${PATH}:${GOBIN}" | |
echo "Added GOBIN to PATH for the current session" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment