Install the Go Language development Environment Instance code-details the work required for the Go Language installation: Install the C language tool, install the mercurial, update the go to the new version, and other operational examples.
Install GO Environment 1, introduction
Go is an open source project with the BSD licensing agreement. This document describes how to get the Go source code, how to compile it, and how to run the Go program.
There are currently two ways to use the Go language. Here's how to use the Go dedicated GC series tools (6g, 8g, etc.). Another optional compiler is the GCCGO compiler based on the GCC backend. For details on GCCGO, refer to Installing and using the GCCGO compiler.
The go compiler can support three sets of instructions. There are some differences in the quality of code generated by different architectures:
AMD64 (a.k.a. x86-64); 6g,6l,6c,6a
The most mature implementations, compiler optimizations at the register level, can generate high-quality target code (sometimes gccgo may be better).
386 (a.k.a. x86 or X86-32); 8g,8l,8c,8a
Complete porting of the AMD64 platform.
Arm (a.k.a. arm); 5g,5l,5c,5a
In the perfect. Currently, only binary files that generate Linux are supported, floating-point support is scarce, and there is a bug in generating the target code. The test set has not been fully passed, and there is no optimization.
In addition to system-level interfaces, go requires a runtime environment that is consistent across platforms. Contains mark-and-sweep garbage memory auto-recycle (more efficient algorithm implementation is under development), arrays, strings, smart stacks, and goroutine.
The following systems are currently supported: FreeBSD, Linux, Native Client, and OS X (a.k.a. Darwin). Microsoft Windows is currently in the middle of a migration and is not fully functional. For a detailed description of each system platform, refer to the following [environment variables] section.
2. Install the C language tool
The tools chain of Go is written in C and the following development tools are required to build:
- Gcc
- C Language standard library,
- Bison,
- Make
- awk, and
- Ed (editor).
For OS X Systems, the above tools are part of Xcode.
For Ubuntu/debian systems, run the Install command: sudo apt-get install bison ed gawk gcc Libc6-dev make
3. Installing mercurial
The mercurial version management system (which can output HG name detection is installed) needs to be installed before any subsequent operations. Install enter the following command:
Install the Go Language development environment