Install go in Ubuntu

Source: Internet
Author: User
Tags install go mercurial

The Go language is an open-source project developed by Google. It aims to improve the programming efficiency of developers. The Go language syntax is flexible, concise, clear, and efficient. Its concurrency features can be easily used for multi-core processor and network development, while flexible and novel type systems can easily write modular systems. Go can be compiled quickly, with the automatic garbage collection function, and supports runtime reflection. Go 11 is an efficient and static type, but the post office has a system-level syntax for interpreting the dynamic type features of a language.

For more information about how to install go on Ubuntu 386, go to http://code.google.com/p/golang-china /.

1. Install the go language tool

sudo apt-get install bison ed gawk gcc libc6-dev make

If the installation fails, the subsequent installation may fail. You can install the installation separately.

2. Install mercurial

Mercurial is actually a Version Management System (you can check whether it is installed by Hg name), similar to git

sudo apt-get install python-setuptoolssudo apt-get install python-devsudo apt-get install build-essential

3. Get the go language source code

4. Configure Environment Variables

$ Vim. bashrc open the. bashrc file in the home directory and add the following information. For more information, see the official documentation.

Export goroot = $ home/go
Export goarch = 386
Export GOOS = Linux
Export path =$ {path}: $ home/bin

Save, save, and exit.

$ Source. bashrc

Make it take effect

5. Install the go language and compile the go environment.

$ CD go/src

$./All. Bash

Start compilation. The following information is displayed after compilation.

You can also run the following command to view the version information:

6. Then we can start working. The suffix of the Go language is. G, 8G is the compiler, and 8l is the connector. You can use vim or other tools.

One of the problems is mentioned here. during compilation, if the left curly braces "{" is a single line, the compilation will fail.

The following problems occur after compilation:

You can change it to the following method.

Compile and run

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.