Monday, November 16, 2009

Commands used to install golang


Commands I used to install Go language (golang) on Ubuntu amd64:

sudo apt-get install mercurial bison gcc libc6-dev ed make
cd ~
export GOROOT=$HOME/go
export GOARCH=amd64
export GOOS=linux
mkdir $HOME/gobin
export GOBIN=$HOME/gobin
export PATH=$PATH:$GOBIN
hg clone -r release https://go.googlecode.com/hg/ $GOROOT
cd $GOROOT/src
./all.bash
To compile something make a test program e.g.:
package main

import "fmt"

func main() {
fmt.Printf("hello, world\n")
}

and compile with:

8g test.go ;8l test.8 ;./8.out

2 comments:

Anthony Fejes said...

I found this post to be quite helpful - thanks. Any reason why the mercurial line is commented out?

new said...

Thanks, I find your blog useful too! :) mercurial shouldn't be commented out, fixed.