Go language Environment building (based on go1.8)

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

Linux (CentOS redhat) installation

1. Access to the official address:

https://golang.org/dl/# #由于相关ZC你懂的, better be able to turn down the wall

2. Download the 64-bit Green pack:

Https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz

3. After the download is complete:

Assume that you want to install the GO directory as $GO _install_dir, followed by the corresponding directory path.

Unzip the tar.gz package into the installation directory: Tar zxvf go1.8.3.linux-amd64.tar.gz-c $GO _install_dir.

4. Add the environment variable vim/etc/profile, adding the following lines

Export path= $PATH: $GO _install_dir/go/bin

Export goroot= $GO _install_dir/go

Export gobin= $GOROOT/bin

Export gopath= $GO _install_dir/go/data # #注意 $GO _install_dir for your GO install or unzip directory

Then execute go

#go

Go is a tool for managing go source code.

Usage:

Go command [arguments]

The commands are:

Build compile packages and dependencies

Clean Remove object files

Doc show documentation for package or symbol

ENV Print Go Environment information

Bug Start a bug report

Fix run Go tool fix on packages

FMT run GOFMT on package sources

Generate generate Go files by processing source

Get download and install packages and dependencies

Install compile and install packages and dependencies

List List Packages

Run compile and run Go program

Test test Packages

Tool run specified Go tool

Version Print Go version

Vet Run Go tool vet on packages

Use the "Go help [command]" For more information about a command.

Additional Help Topics:

C Calling between Go and C

Buildmode Description of Build modes

filetype file types

Gopath gopath environment variable

Environment Environment variables

Importpath Import Path syntax

Packages description of the package lists

Testflag Description of testing flags

TestFunc Description of testing functions

Use ' Go help [topic] ' For more information on that topic.

See the above information to show that the go environment has been built up

But use: Go version to see the release of Go

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.