After you have all this requirements, you are ready to download the latest version of Go from the Google repositories. Open your favourite editor and open ~/.bash_profile. Add the following lines to its end
export GOROOT=$HOME/goNow, to reload your bash profile (without needing to open a new terminal window) type
hg clone -r release https://go.googlecode.com/hg/ $GOROOTThis step can take around one or two minutes. Once you are done, you need to create a ~/bin directory and make it executable, if it doesn't exist. If this is the case,
mkdir ~/binJust one step left
chmod 755 !$
cd $GOROOT/srcThis will take a while and write a lot of information in your terminal window. If everything worked smoothly, you will get a line saying
3 known bugs; 0 unexpected bugsor something along these lines.
For me something didn't work perfect the first time. The problem is that I left it compiling and walked away. When I came back I saw some error related to http tests. I Tried again later, without walking away: I have the Mac OS firewall set on ask. As I didn't answer when prompted if some test program could connect to the Internet, the connection broke and the networking tests didn't proceed. If you also have this firewall setting, you will have to allow 5 or 6 programs. I recommend that you turn off the firewall while compiling, remember to reset it afterwards.
Now, you should have a nice working Go environment. Check if the compiler and linker are to be found
which 8gIf you want to test if it works, you can find a sample hello world program here (Go homepage).
I hope this helped your process of installing (and learning) this language.
8 reader reasons for re-inventing the wheel as a programmer
Approximating images with randomly placed translucent triangles
8 reasons for re-inventing the wheel as a programmer
9 programming books I have read and somewhat liked...
C code juicer: detecting copied programming assignments