Ubuntu下安装go语言(转自豆瓣的网友)
来源:互联网 发布:单片机仿真常用代码 编辑:程序博客网 时间:2024/05/24 07:15
ubuntu 下安装go
1 安装C语言工具集(可选)
sudo apt-get install bison ed gawk gcc libc6-dev make
2 安装SCM 源代码控制管理工具Mercurial(可选)
go源码使用Mercurial管理
2.1 安装mercurial依赖
sudo apt-get install python-setuptools python-dev build-essential
2.2 安装mercurial
sudo easy_install mercurial
3 获取go的源代码
itang@itang-laptop:~/sources$ hg clone -r release https://go.googlecode.com/hg/ go
4 安装go
4.1 编译安装
itang@itang-laptop:~/sources$ cd go/src
itang@itang-laptop:~/sources/go/src$ ./all.bash
...
--- cd ../test
1 known bugs; 0 unexpected bugs
---
Installed Go for linux/386 in /home/itang/sources/go.
Installed commands in /home/itang/sources/go/bin.
*** You need to add /home/itang/sources/go/bin to your $PATH. ***
The compiler is 8g.
4.2 配置环境变量
itang@itang-laptop:~/sources/go/src$ gedit ~/.profile
在文件最后加上一下两行:
export GO_HOME=/home/itang/sources/go
export PATH=$GO_HOME/bin:$PATH
itang@itang-laptop:~/sources/go/src$ source ~/.profile
5 hello,world
5.1 coding
itang@itang-laptop:~/sources/go/src$ cd ~/test
itang@itang-laptop:~/test$ gedit hello.go
输入:
package main
import "fmt"
func main() {
fmt.Printf("hello, 世界\n")
}
5.2 编译/链接/运行
itang@itang-laptop:~/test$ 8g hello.go
itang@itang-laptop:~/test$ 8l hello.8
itang@itang-laptop:~/test$ ./8.out
hello, 世界
6 跟上go的最新发布
$ cd go/src
$ hg pull
$ hg update release
$ ./all.bash
大功告成! 可以进入下一步的go 语言学习了。
(注:国人翻译了go的文档,见http://code.google.com/p/golang-china/)
还有....注意是转载的 原帖在这里(http://www.douban.com/note/101367682/?start=0&post=ok#last)
1 安装C语言工具集(可选)
sudo apt-get install bison ed gawk gcc libc6-dev make
2 安装SCM 源代码控制管理工具Mercurial(可选)
go源码使用Mercurial管理
2.1 安装mercurial依赖
sudo apt-get install python-setuptools python-dev build-essential
2.2 安装mercurial
sudo easy_install mercurial
3 获取go的源代码
itang@itang-laptop:~/sources$ hg clone -r release https://go.googlecode.com/hg/ go
4 安装go
4.1 编译安装
itang@itang-laptop:~/sources$ cd go/src
itang@itang-laptop:~/sources/go/src$ ./all.bash
...
--- cd ../test
1 known bugs; 0 unexpected bugs
---
Installed Go for linux/386 in /home/itang/sources/go.
Installed commands in /home/itang/sources/go/bin.
*** You need to add /home/itang/sources/go/bin to your $PATH. ***
The compiler is 8g.
4.2 配置环境变量
itang@itang-laptop:~/sources/go/src$ gedit ~/.profile
在文件最后加上一下两行:
export GO_HOME=/home/itang/sources/go
export PATH=$GO_HOME/bin:$PATH
itang@itang-laptop:~/sources/go/src$ source ~/.profile
5 hello,world
5.1 coding
itang@itang-laptop:~/sources/go/src$ cd ~/test
itang@itang-laptop:~/test$ gedit hello.go
输入:
package main
import "fmt"
func main() {
fmt.Printf("hello, 世界\n")
}
5.2 编译/链接/运行
itang@itang-laptop:~/test$ 8g hello.go
itang@itang-laptop:~/test$ 8l hello.8
itang@itang-laptop:~/test$ ./8.out
hello, 世界
6 跟上go的最新发布
$ cd go/src
$ hg pull
$ hg update release
$ ./all.bash
大功告成! 可以进入下一步的go 语言学习了。
(注:国人翻译了go的文档,见http://code.google.com/p/golang-china/)
还有....注意是转载的 原帖在这里(http://www.douban.com/note/101367682/?start=0&post=ok#last)
- Ubuntu下安装go语言(转自豆瓣的网友)
- Ubuntu下安装go语言
- Ubuntu下安装go语言
- Ubuntu 下安装Go语言
- Ubuntu 下安装Go语言
- Ubuntu下Go语言环境安装
- 如何在Ubuntu下安装go语言的Ethereum (geth)
- 如何在Ubuntu下安装go语言的Ethereum (geth)
- Ubuntu安装Go语言
- Ubuntu14.04下,GO语言的安装!
- GO语言的简介及Ubuntu下的安装和编译
- Ubuntu 10.x下安装go语言开发环境
- 在ubuntu下安装go语言编译器方法
- Ubuntu下GO语言实践
- Ubuntu安装Go语言环境
- Go语言入门教程(一)Linux下安装Go
- GO语言教程(一)Linux( Centos)下Go的安装, 以及HelloWorld
- GO语言教程(一)Windows下Go的安装, 以及HelloWorld
- vs打包应用程序的方法
- vc6.0 radio控件多个分组
- 【OpenCV】SIFT原理与源码分析:DoG尺度空间构造
- 海外作家评价莫言获奖-当今中国文坛里程碑事件-莫言-诺贝尔文学奖
- windows下c++编写多线程
- Ubuntu下安装go语言(转自豆瓣的网友)
- freeradius研究
- 启动Tomcat出现“Bad version number in .class file (unable to load class XXX)”解决
- android TextView的使用总结
- 轨对轨运放(rail-to-rail)
- EXT3中按照模块加载JS,提高应用程序的加载速度 。
- 空心三角
- ubuntu上的苹果mac主题诱惑
- 备忘日志【五】