ubuntu go install

来源:互联网 发布:淘宝返现客服回复技巧 编辑:程序博客网 时间:2024/05/20 18:46

1)_sudo apt-get install bison ed gawk gcc libc6-dev make

2)apt-get install python-setuptools python-dev build-essential

3)hg clone -u release https://go.googlecode.com/hg/ go

4)cd go/src

5)./all.bash

6)在home的当前用户目录下编辑hello.go

package mainimport "fmt"func main() {fmt.Printf("hello, world\n")}



7)编译并链接

 

cd ~/go/bin

 

./8g ~/hello.go

 

 ./8l ~/hello.8

8)执行

./8.out

 

*********@********-O-E-M:~/go/bin$ ./8.out

hello, world


 

二、版本更新

cd go/src

hg pull

hg update release

./all.bash


原创粉丝点击