DEV Community

Cover image for Go environment
Python64
Python64

Posted on

Go environment

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. Go supports the following systems:

  • Linux
  • FreeBSD
  • Mac OS X (also known as Darwin)
  • Windows

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

Each system corresponding to the package name:

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 code in the UNIX / Linux / Mac OS X, and FreeBSD system installation method:

  1. Download Source Package: go1.4.linux-amd64.tar.gz.

2, unzip the downloaded source package to /usr/ local directory.

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

3, add /usr/ local / go / bin directory to the PATH environment variable:

export PATH = $PATH:/usr/local/go/bin

Note: You can use the MAC system .pkg the end of the installation package by double-clicking to complete the installation, the installation directory /usr/local/go/down.

Windows system installation

Under Windows you can use .msi suffix (download list can be found in the file, such as go1.4.2.windows-amd64.msi) installation package to install.

By default, the .msi files will be installed in the c: \ directory Go. You can c: \ Go \ bin directory to the PATH environment variable. After adding a command window you need to restart to take effect.

installation testing

Create a working directory C: > Go_WorkSpace.

File name: test.go, code is as follows:

    package main
    
    import "fmt"
    
    func main () {
       fmt.Println ( "Hello, World!")
    }

Using the go command code above output results are as follows:

    C:\Go_WorkSpace> go run test.go
    
    Hello, World!

Related links:

Top comments (0)