Compile and install go language (UBUNTU)

Source: Internet
Author: User
Tags install go
VI ~ /. Bashrc # append the following environment variable to the end of the file # export goroot= $ Home/Go # export goarch=386# Export GOOS=Linux # export Gobin= $ Home/Binhg # An invalid command is prompted so that the following command can obtain HgSudoApt-GetInstallMercurialhg clone-R release https://Go.googlecode.com/hg/ $ gorootCD $ goroot/SRC./All. Bash

However, UBUNTU seems to support installation: sudo apt-Get install golang-go

~ /. Bashrc is the environment variable configuration file of the currently logged-on user. After the installation is successful, it seems to be different from the compilation method described on the Internet. I don't know why go is changing rapidly? The compilation command changes from the legendary 6 GB to go

Mkdir~ /Srccd~ /Srcvi hello. Go # Input Source Code go hello. GoLs./Hello

Below is the famous helloProgramGo language version: Hello. Go

Package main

Import "FMT"

Func main (){
FMT. printf ("Hello, world \ n ")
}

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.