This is a creation in Article, where the information may have evolved or changed.
1.0 See if Bash_profile exists
CD ~/.bash_profile
2.0 Create a Bash_profile Mac environment profile If it does not exist
Touch ~/.bash_profile
3.0 Opening Bash_profile
Open-t ~/.bash_profile
4.0 add GO environment variable: (after the equals sign for your project storage directory)
Gopath=website/apple/apps
5.0 Warning: If the go language cannot be installed due to the creation of the Bash_profile mission to invalidate the line LS command, follow
5.1 Open Bash_profile and add environment variables as above
Export path= "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/x11/bin"
5.2 Restart Command line tool remove Bash_profile Close command line remove go file reinstall under (/usr/local/)
RM ~/.bash_profile
5.3 Install the article configuration method reconfiguration can
6 You need to add three folders after configuring a project directory
The $GOPATH directory convention has three subdirectories:
- SRC store source code (e.g.,. Go. C. h, etc.)
- The files generated by the PKG after compilation (for example:. a)
- Bin compiled executable file (for convenience, this directory can be added to the $PATH variable, if there are multiple gopath, then use to
${GOPATH//://bin:}/bin
Add all bin directory)