Linux under Installation configuration go locale

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

1,golang China download Go source http://www.golangtc.com/download please correspond to the system version number, linux-amd64.tar.gz for 64-bit system (recommended) , Linux-386.tar.gz for 32-bit systems

and unzip to the location you want to install (with/home/golang as cases urealyticum compressed to TAR-ZXVF plus file name)

  

2, configure environment variable vim ~/.BASHRC append the following content

Export Gobin=/usr/lib/golang/go/bin
Export Goroot=/usr/lib/golang/go
Export path= $PATH: $GOBIN
Export Gopath=/data/golang/gopher(project directory)

Save exit and Execute command source ~/.BASHRC overload

3. Whether the test environment is built successfully create go files anywhere

Vim Test.go

Append the following content:

Package Main

Import ("FMT")

Func Main () {

Fmt. Printf ("Hello world!")

}

Run go file go run test.go

Successful output Hello World

4, if you have any questions contact Bo Master QQ 495270968 | | Yanggege222221@163.com

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.