Golang Install and Configuration

Source: Internet
Author: User
Golang Install 1. Download go1.8.3

First,download The Go program from the site:

Https://dl.google.com/go/go1.8.3.linux-amd64.tar.gz
2. Install into dir
TAR-XVF go1.8.3.linux-amd64.tar.gz-c/usr/local/
3. Configure the Golang

(1) Add the following lines to profile (/etc/profile)

# vim/etc/profile
# # #GOLANG env###
export goroot=/usr/local/go
export path= $PATH: $GOROOT/bin: $GOPATH/ Bin

(2) Add the following line into BASHRC (Vim ~/.BASHRC)

# vim ~/.BASHRC  
# # #GO env###
Export gopath=/home/golang/

(3) Make it effect

# source/etc/profile
# source ~/.BASHRC

(4) Test go

# Go version
go version go1.8.3 linux/amd64
# Go env
goarch= "AMD64"
gobin= ""
goexe= ""
Gohostarch= "AMD64"
gohostos= "Linux"
goos= "Linux"
gopath= "/home/golang/"
gorace=
"goroot= "/usr/local/go"
gotooldir= "/usr/local/go/pkg/tool/linux_amd64"
gccgo= "Gccgo"
cc= "gcc"
Gogccflags= "-fpic-m64-pthread-fmessage-length=0-fdebug-prefix-map=/tmp/go-build495537484=/tmp/go-build- Gno-record-gcc-switches "
cxx=" g++ "
cgo_enabled=" 1 "
pkg_config=" Pkg-config "
cgo_cflags="-G- O2 "
cgo_cppflags=" "
cgo_cxxflags="-g-o2 "
cgo_fflags="-g-o2 "
cgo_ldflags="-g-o2 "

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.