搭建Go开发环境

sanzhixiong47 · 2016-08-31 08:13:50 · 2736 次点击 · 大约8小时之前 开始浏览    置顶
这是一个创建于 2016-08-31 08:13:50 的主题,其中的信息可能已经有所发展或是发生改变。

##搭建Go开发环境

###一、Linux, Mac OS X, and FreeBSD tar包

####1、安装在默认路径/usr/local

(1)将安装包解压到/usr/local目录下

 > tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz

(2)在/etc/.profile或$HOME/.profile文件中添加如下命令

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

####2、安装在自定义路径下,以$HOME为例

(1)将安装包解压到$HOME目录下

> tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz

(2)在$HOME/.profile文件中添加如下命令

> export GOROOT=$HOME/go
> export PATH=$PATH:$GOROOT/bin

######注:安装在自定义路径下时,GOROOT环境变量必须设置

###二、Mac OS X package安装助手

#####(1)下载package文件,打开它,按提示进行安装,package将Go安装在/usr/local/go目录中

#####(2)将/usr/local/go/bin添加到环境变量PATH

#####(3)重启终端会话让设置生效

###三、Windows下

####1、MSI安装

#####(1)下载MSI文件并打开,按照提示进行安装,默认安装在C:\go目录中

#####(2)将C:\go\bin添加到环境变量PATH

####2、zip包

#####(1)下载zip包并将其解压到任意目录(建议C:\Go

#####(2)如果安装的目录不是C:\Go,必须设置环境变量GOROOT

#####(3)将C:\go\bin添加到环境变量PATH


有疑问加站长微信联系(非本文作者)

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

2736 次点击  ∙  1 赞  
加入收藏 微博
6 回复  |  直到 2016-10-08 13:59:04
AlphaGo
AlphaGo · #1 · 9年之前

I am a novice at these things!
So, I have a low question.

  1. I can not install go in win7.
  2. where is the MSI file? I can not download it in Go.
AlphaGo
AlphaGo · #2 · 9年之前
AlphaGoAlphaGo #1 回复

I am a novice at these things! So, I have a low question. 1. I can not install go in win7. 2. where is the MSI file? I can not download it in [Go](https://golang.org/ 'Golang').

My cpu is 32bit

openadmin
openadmin · #3 · 9年之前

不错,学习了

openadmin
openadmin · #4 · 9年之前
openadminopenadmin #3 回复

不错,学习了

怎么删除不了评论

sanzhixiong47
sanzhixiong47 · #5 · 9年之前
AlphaGoAlphaGo #1 回复

I am a novice at these things! So, I have a low question. 1. I can not install go in win7. 2. where is the MSI file? I can not download it in [Go](https://golang.org/ 'Golang').

纳尼,I have installed it on Win8 and U can get MSI file from web site of golang.org.

sanzhixiong47
sanzhixiong47 · #6 · 9年之前
openadminopenadmin #4 回复

#3楼 @openadmin 怎么删除不了评论

估计开发者没有实现这个功能吧,哈哈

添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传