码迷,mamicode.com
首页 > 编程语言 > 详细

Windows/Centos安装GO语言环境

时间:2016-01-06 13:40:58      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:

转载:http://www.haiyun.me/archives/1009.html

Centos下使用epel源安装:

1
yum install golang

Centos/Linux下源码安装golang:

1
2
3
4
5
6
7
wget https://storage.googleapis.com/golang/go1.4.1.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.4.1.linux-amd64.tar.gz
mkdir $HOME/go
echo ‘export GOROOT=/usr/local/go‘ >> ~/.bashrc
echo ‘export GOPATH=$HOME/go‘ >> ~/.bashrc
echo ‘export PATH=$PATH:$GOROOT/bin:$GOPATH/bin‘ >> ~/.bashrc
source $HOME/.bashrc

安装go get工具:

1
yum install mercurial git bzr subversion

Windows下安装:

1
https://storage.googleapis.com/golang/go1.4.1.windows-386.zip

设置环境变量:

1
2
3
4
5
setx GOOS windows
setx GOARCH 386
setx GOROOT "D:\Program Files\go"
setx GOBIN "%GOROOT%\bin"
setx PATH %PATH%;D:\Program Files\go\bin"

Windows/Centos安装GO语言环境

标签:

原文地址:http://www.cnblogs.com/h2zZhou/p/5105137.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!