Centos7 Installing the Go Language development environment

Source: Internet
Author: User

1. Installation

yum install  golang

2. Configure Environment variables

New Go directory as project directory

mkdir -p $HOME/go

Use the Cat method to add configuration Golang at the tail goroot gopath

cat >>$HOME/.bash_profile<<EOFexport GOROOT=/usr/lib/golangexport GOPATH=\$HOME/golangexport PATH=\$PATH:\$GOROOT/binEOF

Let the configuration take effect

source $HOME/.bash_profile

3. Check the ENV environment variable of Go

go env

Output

  goarch= "AMD64" gobin= "goexe=" "gohostarch=" AMD64 "gohostos=" Linux "goos=" Linux "gopath="/root/golang " Gorace= "" goroot= "/usr/lib/golang" gotooldir= "/usr/lib/golang/pkg/tool/linux_amd64" GCCGO= "GCCGO" CC= "GCC" Gogccflags= "-fpic-m64-pthread-fmessage-length=0-fdebug-prefix-map=/tmp/go-build349580051=/tmp/go-build- Gno-record-gcc-switches "cxx=" g++ "cgo_enabled=" 1 "cgo_cflags="-g-o2 "cgo_cppflags=" "cgo_cxxflags="-g-o2 "CGO_ fflags= "-g-o2" cgo_ldflags= "-g-o2" pkg_config= "Pkg-config"  
Related Article

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.