Go Language Environment Installation

Source: Internet
Author: User

The Go language supports the following systems:

    • Linux
    • Freebsd
    • Mac OS X (also known as Darwin)
    • Window

The installation package is: https://golang.org/dl/.

Package name for each system:

Operating System Package Name
Windows Go1.4.windows-amd64.msi
Linux Go1.4.linux-amd64.tar.gz
Mac Go1.4.darwin-amd64-osx10.8.pkg
Freebsd Go1.4.freebsd-amd64.tar.gz
Unix/linux/mac OS X, and FreeBSD installation

The following describes the use of the source installation method under Unix/linux/mac OS X, and FreeBSD systems:

1, download the source package: go1.4.linux-amd64.tar.gz.

2. Extract the downloaded source package to the/usr/local directory.

Tar-c/usr/local-xzf go1.4.linux-amd64.tar.gz

3. Add the/usr/local/go/bin directory to the PATH environment variable:

Export path= $PATH:/usr/local/go/bin

Note: Under MAC system you can use the. Pkg end of the installation package directly double-click to complete the installation, the installation directory under/usr/local/go/.

Installation under Windows system

Windows can be installed under an installation package that uses the. msi suffix (which can be found in the download list for the file, such as Go1.4.2.windows-amd64.msi).

By default, the. msi file is installed in the C:\Go directory. You can add the C:\Go\bin directory to the PATH environment variable. You will need to restart the Command window to take effect after adding.

Installation test

Create the working directory C:\>go_workspace.

File name: Test.go, the code is as follows:

Package Mainimport "FMT" Func Main () {   fmt. Println ("Hello, world!")}

Use the GO command to execute the above code output as follows:

C:\go_workspace>go Run Test.gohello, world!

Go Language Environment Installation

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.