This is a creation in Article, where the information may have evolved or changed.
1. Download the installation package
Because the official website was wall, so to a domestic go forum download: Click to enter the download
After downloading, double-click to install.
2. Configure Environment variables
GOROOT :gol aNgAnninstalledMeshRecord Gopath:go lang working directory, kind of like eclipse.
Start configuration below
Enter the following command into the terminal:
vim ~/.bash# 打开环境变量配置
At the bottom of the add
export GOPATH=/Users/# 改成你喜欢的路径export# 默认安装都市这个路径
When you are finished adding, exit vim
Enter the following command into the terminal:
source# 让环境变量配置生效
When you are finished, create a new three folder in the $gopath directory
bin:存放编译后的可执行文件;pkg:存放编译后的包文件;src:存放项目源文件;
Finally, enter the following command into the terminal to verify that the installation was successful:
version
A similar image appears to be successful, if not successful, please check your environment variable configuration.
3.IDE
I. Sublime Text (personal preference)
After installing the Sublimetext, install the plug-in manager, go to the plug-In Manager installation, enter Gosublime, go to install
After the installation is complete, you will also install a syntax hint plugin:
Enter the command into the terminal:
go get github.com/nsf/gocodego install github.com/nsf/gocode
Two. Liteide
Download Address: Liteide
Download one of the
Unzip is available
Three. Wide
Project Address: Wide Project
Official Address: Official website
After downloading, use go to run, in the browser to open the specified IP and port can be used (for details, please refer to the official website)
4. Learn Go lang
- Official tutorial: Skip the Wall
- Go Language Chinese Web: Go language Chinese web
- Golang China: Golang China