go语言:linux 源码安装
xujinping · · 3907 次点击 · · 开始浏览首先下载源码:http://www.golangtc.com/download
解压后,进入src文件夹,执行 ./all.bash
等待安装结束后,把目录复制到/usr/local/里,设置两个环境变量:
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
然后就可以测试啦
Create a file named hello.go and put the following program in it:
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
Then run it with the go tool:
$ go run hello.go hello, world
If you see the "hello, world" message then Go is installed correctly.
听说最新的GO 1.5 使用go来编译go,看来他们是对自己的东西绝对有信心,没bug啦。
有疑问加站长微信联系(非本文作者)
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
关注微信- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码` - 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传
收入到我管理的专栏 新建专栏
首先下载源码:http://www.golangtc.com/download
解压后,进入src文件夹,执行 ./all.bash
等待安装结束后,把目录复制到/usr/local/里,设置两个环境变量:
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
然后就可以测试啦
Create a file named hello.go and put the following program in it:
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
Then run it with the go tool:
$ go run hello.go hello, world
If you see the "hello, world" message then Go is installed correctly.
听说最新的GO 1.5 使用go来编译go,看来他们是对自己的东西绝对有信心,没bug啦。