Skip to content

Instantly share code, notes, and snippets.

@vitonzhangtt
Created August 25, 2019 09:25
Show Gist options
  • Save vitonzhangtt/b3b1e038d18bf374822e3edab762af06 to your computer and use it in GitHub Desktop.
Save vitonzhangtt/b3b1e038d18bf374822e3edab762af06 to your computer and use it in GitHub Desktop.
Setup environment variables for Go Workspace
#! /bin/bash
###############################################
# Export env via shell script: source ./setupEnvShellScript.sh
# $source ./setupEnvForGoWorkspace.sh
#
################################################
################ Export GOPATH ##############
PWD=`pwd`
#echo $PWD
export GOPATH=$PWD
################ Export GOBIN ##############
export GOBIN=$GOPATH/bin
################ Add GOBIN to PATH ##############
PATH=$PATH:$GOBIN
export PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment