首页 > 数据库 > redis > codis > 安装go语言包
2015
07-19

安装go语言包

我的系统是64位的,所以下载的go1.4.2.linux-amd64.tar.gz

解压后到
go/src 目录下面
./all.bash 

运行all.bash后出现”ALL TESTS PASSED”字样时才算安装成功。
需要设置环境变量
vim /etc/profile
export GOPATH=$HOME/gopath 
export PATH=$PATH:$HOME/go/bin:$GOPATH/bin
source /etc/profile
这样就按照好了,测试下
# 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 that topic.
如果出现Go的Usage信息,那么说明Go已经安装成功了;如果出现该命令不存在,那么可以检查一下自己的PATH环境变中是否包含了Go的安装目录。
最后编辑:
作者:saunix
大型互联网公司linux系统运维攻城狮,专门担当消防员

留下一个回复