Ubuntu System Installation Golang

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

Objective

Every time you learn a new language, the environment you want to build is the most vexing problem.
The following is a summary of the self, but also hope to help everyone, if there are questions to point out. Thank you!

Version information

The version I'm using is

  • VirtualBox 5.0
  • Ubuntu 14.04

Installation

The Ubuntu system can use the Apt-get command to obtain and install the appropriate program.
sudo apt-get install golangAfter the installation is complete,
go envCheck to see if the installation was successful. If there is no successful installation, you will be prompted to continue the installation as prompted.

Set directory structure

At the command line, enter:
cd $HOME mkdir go //创建工作目录 cd go mkdir src bin pkg //src存放源代码,,pkg存放编译后存放的文件,bin存放编译后生成的可执行文件

Settings for Environment variables

At the command line, entersudo vim /etc/profile
You just have to add it to the file export GOPATH=$HOME/go .
Because the environment variables such as goroot have been set according to your default installation location.

View GO Environment variables

Command Line Input:go env

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.