Ubuntu Build Go Environment

Source: Internet
Author: User

1. Enter/home, download the latest 64-bit under http://www.golangtc.com/, sudo wget xxxxx

2. Decompress sudo tar-zxvf Go-xxxxxx.tar go

3.

Compiling go

CD $GOROOT/SRC

./all.bash

After the completion of the compilation will be automatically tested, if the test net/http link google.com, the domestic environment a little bit unstable, if not recommended to add an environment variable

Export Disable_net_tests=1

To skip the net test.

4.

Environment configuration:
sudo vi/etc/profile
Join
Export Goroot=/home/go
Export goarch=AMD64
Export Goos=linux
Export Gopath=/home/gopath
Export gobin= $GOROOT/bin
Export path= $GOROOT/bin: $PATH

Source/etc/profile

5.

New directory for Gopath sudo mkdir gopath

Create a new three directory under Gopath
sudo mkdir src pkg bin
SRC Storage Source
Pkg to store compiled generated files
Bin holds the resulting executable file

6.git Installation

sudo apt-get install git

sudo apt-get install git-core actually useless

Ubuntu Build Go Environment

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.