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:
Installing Required ToolsCode:$uname -a >2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux
Install GCC and Mercurial:
Setting Up Your EnvironmentCode:$sudo apt-get install mercurial bison gcc libc6-dev
1) Make 'bin' directory for go - You may have one - this will create it for you if you don't:
2) Setting up environmental variables:Code:$mkdir ~/bin
Edit your Bash environment variables to include the Go required variables as well as making sure your bin folder is in the $PATH
Add following to your .bashrc - note: If using 386, set "GOARCH=386" (worked great on my EeePC):Code:$cp ~/.bashrc ~/.bashrc.bu $gedit ~/.bashrc
Reload .bashrcCode:#Google Go Vars export GOROOT=~/go export GOOS=linux export GOARCH=amd64 PATH=${PATH}:$HOME/bin
Note: You can close your terminal session and restart terminal instead. Up to you.Code:$source .bashrc
Check out Go ( to your Go root using Mercurial)
Note: I had to pull an update due to errors during make (details below with build instructions):Code:$hg clone -r release https://go.googlecode.com/hg/ $GOROOT
Building GoCode:$cd $GOROOT $hg pull -u
If successful, results should be:Code:$cd $GOROOT/src $./all.bash
Note on make errors: Before pulling an update on the repository, make resulted in:Code:>--- cd ../test >0 known bugs; 0 unexpected bugs
Updating via the 'hg pull -u' command above resolved this issue and allowed make to complete as desired.Code:>make[1]: Leaving directory `/home/eznet/go/src/pkg/net' >make: *** [net.test] Error 2
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.
Bookmarks