This is a creation in Article, where the information may have evolved or changed.
Now Docker and kubernetes and other containers related to the technology is hot, but there is no one-click installation of the Go Language development environment, I through a few days of groping, on the CENTOS7 to build a vim development golang of the entire environment, including Nerdtree, taglist , Tagbar, Ctags, gotags, syntax highlighting, Gocode, Godoc for code Auto-completion, godef for jumping to variables and method definitions, and so on. I've put all of the environment-related programs and settings into several folders, just to set the response directory for the folder copy to be successful.
I am working with the root user, the following commands are based on this.
First, install the Go language binary package, download the address https://github.com/golang/go/releases/tag/go1.4.2, download it to the/usr/local directory, and then set the environment variable in the. bashrc file as follows:
Export Gopath=/home/go/goprojects
Export path= $PATH: $GOPATH/bin
Export Goroot=/usr/local/go
Export path= $PATH: $GOROOT/bin
Then execute the SOURCE/ROOT/.BASHRC command, and then build the Gopath directory.
Since then, the Go language execution environment has been set up, the terminal input Go Version command can display the Golang version number, the following is the development environment settings:
1. Golang Development of Vim plugin
Download the Vim plugin package from http://download.csdn.net/detail/yuanfang_way/9141485 and unzip it directly in the/root directory after downloading
The VIMRC of the 2.golang development environment
Download the. vimrc file from http://download.csdn.net/detail/yuanfang_way/9141493, and drop it directly into the/root directory
The goprojects of the 3.golang development environment
Download the Goprojects package from http://download.csdn.net/detail/yuanfang_way/9141505, which contains executable files such as Gotags, Godef, and the Go Language pack, At the same time, it also contains the recent fire of the Docker source package, can be used directly.
So far has been set up all the work related to Golang development, complete these can be like using VIM development C language to develop the go language, can be generated by the gotags command tags, can be gocode to achieve automatic completion, with Godef jump to function and variable definition and so on. What are the shortcut keys, and so on more time.
You only need to copy the. VIMRC and. Vim folders to your new computer, and if you need a go language development environment, you need to configure Gopath, Goroot, and copy Gocode and gotags from the src and bin in Gopath to the corresponding folder in the new system.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.