This is a created article in which the information may have evolved or changed.
Objective
Every time you learn a new language, the environment you want to build is the most vexing problem.
The following is a summary of the self, but also hope to help everyone, if there are questions to point out. Thank you!
Version information
The version I'm using is
- VirtualBox 5.0
- Ubuntu 14.04
Installation
The Ubuntu system can use the Apt-get command to obtain and install the appropriate program.
sudo apt-get install golangAfter the installation is complete,
go envCheck to see if the installation was successful. If there is no successful installation, you will be prompted to continue the installation as prompted.
Set directory structure
At the command line, enter:
cd $HOME mkdir go //创建工作目录 cd go mkdir src bin pkg //src存放源代码,,pkg存放编译后存放的文件,bin存放编译后生成的可执行文件
Settings for Environment variables
At the command line, entersudo vim /etc/profile
You just have to add it to the file export GOPATH=$HOME/go .
Because the environment variables such as goroot have been set according to your default installation location.
View GO Environment variables
Command Line Input:go env