Install the Go Language development environment

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Installing Atom via PPA

sudo add-apt-repository ppa:webupd8team/atom  sudo apt-get  update  sudo apt-  Get

Installing Golang

Download the latest Linux version of the zip package in https://golangtc.com/download , as I downloaded is

Go1.9.linux-amd64.tar.gz

Unzip the package

sudo tar-zxvf go1. 9. Linux-amd64.tar.gz-c/usr/local/

Open Etc/profile Modify environment variables, you can use Vim can also use graphical interface method, note to sudo administrator permissions to be able to modify the file to save

sudo gedit/etc/profile

The following links can be used to see how to modify the interpretation of Etc/profile and profile files:

Https://zhidao.baidu.com/question/121463086.html

Http://blog.chinaunix.net/uid-25749806-id-298287.html

Add environment variables to the last line of the profile and recompile the profiles, otherwise check that go installation is not passed because path is not yet valid

Export path= $PATH:/usr/local/go/bin
export GOPATH=$HOME/gowork
export PATH=$PATH:$GOPATH/bin

Source/etc/profile

Next check if the installation is successful

Go Versiongo env

Atom Plugin and Golang

Use Atom to install Go-plus tools https://segmentfault.com/a/1190000004933373

Just installed the atom of the children can not find a search by searching the

Then the link said in the upper Preference left packages inside the setting views of the install packages inside

Search to Go-plus, click Intall

However, I have the following problems:

Installing "go-plus@5.5.5"failed. Hide Output...gyp Info It workedifit ends with OKGYP infousingnode-gyp@3.4.0Gyp Infousingnode@6.9.5| Linux |x64gyp http GET https://atom.io/download/electron/v1.6.9/iojs-v1.6.9.tar.gzgyp WARN Install got an error, rolling back Installgyp ERR!Install error Gyp ERR! Stack Error:connect etimedout54.231.50.10:443Gyp ERR! Stack at object.exports._errnoexception (util.js:1022: One) Gyp ERR! Stack at Exports._exceptionwithhostport (util.js:1045: -) Gyp ERR! Stack at tcpconnectwrap.afterconnect [ asOnComplete] (net.js:1087: -) Gyp ERR! System Linux3.13.0- +-Genericgyp ERR! Command"/opt/atom/resources/app/apm/bin/node" "/opt/atom/resources/app/apm/node_modules/node-gyp/bin/node-gyp.js" "Install" "--runtime=electron" "--target=1.6.9" "--dist-url=https://atom.io/download/electron" "--arch=x64" "--ensure"Gyp ERR! cwd/home/xiaoyubei/. Atomgyp ERR! NODE-V V6.9.5Gyp ERR! NODE-GYP-V v3.4.0Gyp ERR! Not OK


From http GET https://atom.io/download/electron/v1.6.9/iojs-v1.6.9.tar.gz disconnected, guess is wall up ~

Let's go over the wall:http://www.cnblogs.com/iamxiaoyubei/p/7610609.html

Fq several times after the download, the installation was successful

Installing missing tools

Go-plus after installation, open a new document at Atom Random or turn it into the go language

Then go-plus on the right pop-up box Let's install a lot of things

Click to install all

However some of them are not installed successfully

[~]$ Go env ... Goroot=" ... " ...

You can find these execution files under $goroot/bin.

If you do not see the installation is not successful, we need to manually install

Reference https://studygolang.com/articles/10263

To download the source code locally, if you have the Tools folder local and empty, delete this folder before cloning

# Create folder mkdir $GOPATH/src/golang.org/x/# Go to Folder CD $GOPATH/src/golang.org/x/# download source git clone https:  //github.com/golang/tools.git

Install the kit, you don't see the kit is installed all over again

Besides golang.org/x inside, there's github.com inside.

Take a look and you can see that github.com has been downloaded in $gopath/src.

Go install golang.org/x/tools/cmd/goimportsgo install golang.org/x/tools/cmd/gorenamego Install golang.org/x/tools/cmd/Guru
Go Install Github.com/sqs/goreturns
Go Install Github.com/zmb3/gogetdoc
Get The waiting ...

Install super fast
After the installation is complete, you can see these execution files under $goroot/bin

The development environment for GO language is complete.

Then we will use the go language to happily program it:)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.