Go语言精简总结(Part One) - The way to Go

安装

1
2
3
4
5
6
7
8
9
$ apt-get install bison ed gawk libc6-dev mercurial python-setuptools python-dev build-essential
$ hg clone -r release https://go.googlecode.com/hg/ go
$ export GOROOT=$HOME/go
$ export GOARCH=amd64
$ export GOOS=linux
$ export GOTOOL=$HOME/go/pkg/tool/linux_amd64/
$ export PATH=.:$PATH:$GOBIN:$GOTOOL
$ cd go/src
$ ./all.bash

更新go版本

1
2
3
$ cd $GOROOT && hg identify
$ hg pull && hg update release
$ ./all.bash

Workspace 示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
bin/
todo # command executable
pkg/
linux_amd64/
code.google.com/p/goauth2/
oauth.a # package object
github.com/nf/todo/ task.a
src/
code.google.com/p/goauth2/
.hg/ # mercurial repository metadata
oauth/
oauth.go # package source
oauth_test.go # test source
github.com/nf/
todo/
.git/
task/
task.go # package source
todo.go

more >>