eznet
November 11th, 2009, 07:19 AM
Google Go
Go is Google's newest offering to the development community. According to the project's page, Go is an expressive, concurrent, garbage collected programming language that is simple, fast, safe, concurrent, fun and (best of all) open source. Touted as a cross between C/C++ and Python, Go seems to be generating a lot of buzz and hoards of seemingly early adopters despite having surfaced only earlier today (11.10.2009) . Of course this is somewhat expected - what has Google ever released that didn't generate it's share of hype/buzz/excitement associated with it?
I bit. I am guessing since you are reading this, you did too.
Getting Ready to Go
The following instructions detail the steps that I used to setup Go on my x64 Ubuntu 9.10 (Karmic Koala) box.
Standard disclaimer: Your mileage may vary. For me everything was pretty much straight forward when following the maintainer's provided setup instructions (http://golang.org/doc/install.html). The only hiccup I encountered during setup was an error with a test during make - Error 2 in [net.test]. A quick bounce over to #go-nuts resolved that - friendly go-nut knowledge base, iant, advised me that there was an issue with this test on some machines in the release version and that I should pull an update. Update pulled, problem fixed.
For simplicity sake, I am working from the gnome-terminal. Access bash as you see fit. When you see '$', it denotes a command to enter in the CLI (Command Line Interface). When you see '>', it denotes and output line.
FYI - My Machine Info:
$uname -a
>2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux
Installing Required Tools
Install GCC and Mercurial:
$sudo apt-get install mercurial bison gcc libc6-dev
Setting Up Your Environment
1) Make 'bin' directory for go - You may have one - this will create it for you if you don't:
$mkdir ~/bin
2) Setting up environmental variables:
Edit your Bash environment variables to include the Go required variables as well as making sure your bin folder is in the $PATH
$cp ~/.bashrc ~/.bashrc.bu
$gedit ~/.bashrc
Add following to your .bashrc - note: If using 386, set "GOARCH=386" (worked great on my EeePC):
#Google Go Vars
export GOROOT=~/go
export GOOS=linux
export GOARCH=amd64
PATH=${PATH}:$HOME/bin
Reload .bashrc
$source .bashrc
Note: You can close your terminal session and restart terminal instead. Up to you.
Check out Go ( to your Go root using Mercurial)
$hg clone -r release https://go.googlecode.com/hg/ $GOROOT
Note: I had to pull an update due to errors during make (details below with build instructions):
$cd $GOROOT
$hg pull -u
Building Go
$cd $GOROOT/src
$./all.bash
If successful, results should be:
>--- cd ../test
>0 known bugs; 0 unexpected bugs
Note on make errors: Before pulling an update on the repository, make resulted in:
>make[1]: Leaving directory `/home/eznet/go/src/pkg/net'
>make: *** [net.test] Error 2
Updating via the 'hg pull -u' command above resolved this issue and allowed make to complete as desired.
GO play with Go
Tutorial: http://golang.org/doc/go_tutorial.html
http://blog.eznet.frih.net/?p=121
Edit:"Installing Required Tools" was modified to skip Python's Setup Tools as mbudde pointed out that mercurial is available from the Ubuntu repositories.
Go is Google's newest offering to the development community. According to the project's page, Go is an expressive, concurrent, garbage collected programming language that is simple, fast, safe, concurrent, fun and (best of all) open source. Touted as a cross between C/C++ and Python, Go seems to be generating a lot of buzz and hoards of seemingly early adopters despite having surfaced only earlier today (11.10.2009) . Of course this is somewhat expected - what has Google ever released that didn't generate it's share of hype/buzz/excitement associated with it?
I bit. I am guessing since you are reading this, you did too.
Getting Ready to Go
The following instructions detail the steps that I used to setup Go on my x64 Ubuntu 9.10 (Karmic Koala) box.
Standard disclaimer: Your mileage may vary. For me everything was pretty much straight forward when following the maintainer's provided setup instructions (http://golang.org/doc/install.html). The only hiccup I encountered during setup was an error with a test during make - Error 2 in [net.test]. A quick bounce over to #go-nuts resolved that - friendly go-nut knowledge base, iant, advised me that there was an issue with this test on some machines in the release version and that I should pull an update. Update pulled, problem fixed.
For simplicity sake, I am working from the gnome-terminal. Access bash as you see fit. When you see '$', it denotes a command to enter in the CLI (Command Line Interface). When you see '>', it denotes and output line.
FYI - My Machine Info:
$uname -a
>2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux
Installing Required Tools
Install GCC and Mercurial:
$sudo apt-get install mercurial bison gcc libc6-dev
Setting Up Your Environment
1) Make 'bin' directory for go - You may have one - this will create it for you if you don't:
$mkdir ~/bin
2) Setting up environmental variables:
Edit your Bash environment variables to include the Go required variables as well as making sure your bin folder is in the $PATH
$cp ~/.bashrc ~/.bashrc.bu
$gedit ~/.bashrc
Add following to your .bashrc - note: If using 386, set "GOARCH=386" (worked great on my EeePC):
#Google Go Vars
export GOROOT=~/go
export GOOS=linux
export GOARCH=amd64
PATH=${PATH}:$HOME/bin
Reload .bashrc
$source .bashrc
Note: You can close your terminal session and restart terminal instead. Up to you.
Check out Go ( to your Go root using Mercurial)
$hg clone -r release https://go.googlecode.com/hg/ $GOROOT
Note: I had to pull an update due to errors during make (details below with build instructions):
$cd $GOROOT
$hg pull -u
Building Go
$cd $GOROOT/src
$./all.bash
If successful, results should be:
>--- cd ../test
>0 known bugs; 0 unexpected bugs
Note on make errors: Before pulling an update on the repository, make resulted in:
>make[1]: Leaving directory `/home/eznet/go/src/pkg/net'
>make: *** [net.test] Error 2
Updating via the 'hg pull -u' command above resolved this issue and allowed make to complete as desired.
GO play with Go
Tutorial: http://golang.org/doc/go_tutorial.html
http://blog.eznet.frih.net/?p=121
Edit:"Installing Required Tools" was modified to skip Python's Setup Tools as mbudde pointed out that mercurial is available from the Ubuntu repositories.