, ~/go ~/.bashrc, $GOROOT ~/gosource.
Go Getting Started. , , ; , enter. $ , . , Linux , / \. ; . , env, pwd, which uname. " ", .
~/.bashrc.
$ gedit ~/.bashrc
export GOROOT=$HOME/go
export GOARCH=amd64
export GOOS=linux
export GOBIN=$GOROOT/bin
export PATH=$PATH:$GOBIN
, , ~./bashrc .
$ env | grep '^\(GO\|HOME=\|PATH=\)'
GOBIN=/home/peter/go/bin
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/peter/go/bin
GOARCH=amd64
HOME=/home/peter
GOROOT=/home/peter/go
GOOS=linux
$ cd $GOROOT/src
$ pwd
/home/peter/go/src
$ uname -a
Linux peter 2.6.32-31-generic
$GOROOT, .
$ hg clone -u release https://go.googlecode.com/hg/ $GOROOT
requesting all changes
adding changesets
adding manifests
adding file changes
added 8441 changesets with 31916 changes to 4421 files (+1 heads)
updating to branch release-branch.r57
2702 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd $GOROOT/src
$ ./all.bash
< SNIP OUTPUT >
ALL TESTS PASSED
Installed Go for linux/amd64 in /home/peter/go.
Installed commands in /home/peter/go/bin.
The compiler is 6g.
$ which 6g
/home/peter/go/bin/6g
, , .
, " Go", "go"; Linux , "Go" "go" .
$GOROOT hg clone $GOROOT , hg clone hg. ,
$ env | grep '^GOROOT'
GOROOT=
$ hg clone -u release https://go.googlecode.com/hg/ $GOROOT
destination directory: hg
GOARCH=amd64, 64- Linux Mint x86_64. uname -a? , 6g 6l x86_64, $GOBIN, $PATH.
$ env | grep '^\(GOBIN\|PATH=\)'
GOBIN=/home/peter/go/bin
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/peter/go/bin
$ which 6g
/home/peter/go/bin/6g
, ./all.bash.
ALL TESTS PASSED
---
Installed Go for linux/amd64 in /home/peter/go.
Installed commands in /home/peter/go/bin.
The compiler is 6g.