This is a creation in Article, where the information may have evolved or changed.
Install go language under Ubuntu
The go language is an open source project developed by Google, one of the purposes of which is to improve developer productivity. Go language grammar is flexible, concise, clear and efficient. Its concurrency features can be conveniently used for multi-core processors and network development, while flexible and innovative type systems can easily write modular systems. Go can be compiled quickly, with the garbage Memory auto-recycle feature, and also support runtime reflection. Go 11 is an efficient, static type, but the post office has a system-level syntax that interprets the dynamic type characteristics of the language.
Because only introduced Ubuntu under 386 of the Go Language installation method, other platforms can be viewed on the 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 above is not installed on the May cause the later can not be installed, users may also be installed, so that the insurance write
2, installation Mercurial
Mercurial is actually a version management system (can be detected by HG name is installed), similar to Git
?
sudo apt-get install python-setuptools sudo apt-get install python-dev sudo apt-get install build-essential |
3. Get the Go Language source
4. Configure Environment variables
$vim. BASHRC open the. bashrc file in the home directory, add the following information, referring to the official documentation
Export goroot= $HOME/go
Export goarch=386
Export Goos=linux
Export Path=${path}: $HOME/bin
Save Save after exit execution
$source. BASHRC
Make it effective
5. Install go language, compile go environment
$CD GO/SRC
$./all.bash
Start compiling, the following information is displayed when compiling is completed
You can also view the version information by following the command
6, then we can start to work, the Go language suffix is. g,8g is the compiler, 8l is the connector. Can be written with vim, or other tools can be
Here is one of the problems, when writing if the left curly brace "{" A single line will compile an error
The following problems occurred after compiling
Modify it to the following way.
Compile run