Ubuntu Go语言安装记录

1 篇文章 0 订阅
1 篇文章 0 订阅

参考地址:http://golang.org/doc/install.html

 

一些区别:

 

amd64   (a.k.a.   x86-64 );   6g,6l,6c,6a
The most mature implementation. The compiler has an effective optimizer (registerizer) and generates good code (although   gccgo   can do noticeably better sometimes).
386   (a.k.a.   x86   or   x86-32 );   8g,8l,8c,8a
Comparable to the   amd64   port.
arm   (a.k.a.   ARM );   5g,5l,5c,5a
Incomplete. It only supports Linux binaries, the optimizer is incomplete, and floating point uses the VFP unit. However, all tests pass. Work on the optimizer is continuing. Tested against a Nexus One.



 

 

安装必要依赖:
$ sudo apt-get install bison gawk gcc libc6-dev make python-setuptools python-dev build-essential

 

    安装Hg:

$sudo easy_install mercurial
 

    获取go源码:

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

 

   安装:

$ cd go/src
$ ./all.bash

 

    看到如下信息就是安装成功:

--- cd ../test
0 known bugs; 0 unexpected bugs

ALL TESTS PASSED

---
Installed Go for linux/amd64 in /home/zc/opt/go.
Installed commands in /home/zc/opt/go/bin.
The compiler is 6g.

 

    验证:

$ cat >hello.go <<EOF
package main

import "fmt"

func main() {
fmt.Printf("hello, world\n")
}
EOF
$ 6g hello.go
$ 6l hello.6
$ ./6.out
hello, world
$
go lang 更新:
$ cd go/src
$ hg pull
$ hg update release
$ ./all.bash
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值