インストール

1
2
3
cd /tmp
wget https://storage.googleapis.com/golang/go1.4.linux-amd64.tar.gz --no-check-certificate
tar -C /usr/local -xzf  go1.4.linux-amd64.tar.gz

環境変数PATHにgoコマンドのパスを通す

1
2
3
cat << EOT >> ~/.bash_profile
export PATH=$PATH:/usr/local/go/bin
EOT

goコマンドのヘルプ

  • goと実行し、以下のように表示されればインストール成功です
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# go
Go is a tool for managing Go source code.

Usage:

        go command [arguments]

The commands are:

    build       compile packages and dependencies
    clean       remove object files
    env         print Go environment information
    fix         run go tool fix on packages
    fmt         run gofmt on package sources
    generate    generate Go files by processing source
    get         download and install packages and dependencies
    install     compile and install packages and dependencies
    list        list packages
    run         compile and run Go program
    test        test packages
    tool        run specified go tool
    version     print Go version
    vet         run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

    c           calling between Go and C
    filetype    file types
    gopath      GOPATH environment variable
    importpath  import path syntax
    packages    description of package lists
    testflag    description of testing flags
    testfunc    description of testing functions

Use "go help [topic]" for more information about