This is a creation in Article, where the information may have evolved or changed.
This article describes the installation and uninstallation of the Go Language compilation tool.
1. Installation
Download binary files for the corresponding system https://golang.org/dl/
If it is an upgrade Go tool, uninstall the old version before installing the new version.
Unzip the downloaded package file to the /usr/local directory
<textarea wrap="soft" class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 13px !important; line-height: 18px !important;">tar-c/usr/local-xzf go$version. $OS-$ARCH. tar.gz</textarea>
| 12 |
tar - c / usr / local - xzf go $ version $ os - $ arch tar gz |
/usr/local/go/binAdd a directory to an environment variable
Compile /etc/profile or $HOME/.profile file, add the following line:
<textarea wrap="soft" class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 13px !important; line-height: 18px !important;">export path= $PATH:/usr/local/go/bin</textarea>
| 12 |
Export PATH = $ PATH : / usr / Local / Go / bin |
2. Test the installation
To see go If the tool was successfully installed
<textarea wrap="soft" class="crayon-plain print-no" data-settings="dblclick" readonly="" style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 13px !important; line-height: 18px !important;">$ go versiongo version go1.7.5 darwin/amd64</textarea>
| 123 |
$ Go versiongo version go1. 7.5 Darwin/AMD64 |
3. Uninstall
Remove /usr/local/go The directory, remove the imported /usr/local/go/bin environment variable
Reference
- Getting Started
- Download Package
@ Just small yards farm