Goをインストールして、"Hello, World"してみた
基本的には"Getting Started - The Go Programming Language"通りで。
### 環境変数とか $ export GOROOT=$HOME/go $ export GOOS=linux $ export GOARCH=386 $ export GOBIN=$HOME/bin $ export PATH=$HOME/bin:$PATH $ mkdir $HOME/bin ### ビルドに必要なもの $ sudo aptitude install bison gcc libc6-dev ed make mercurial ### チェックアウト・ビルド $ hg clone -r release https://go.googlecode.com/hg/ $GOROOT $ cd $GOROOT/src $ ./all.bash
"Hello, World"なプログラム。
package main import "fmt" func main() { fmt.Printf("Hello, World\n") }
コンパイル、リンク、実行。
$ 8g hello.go $ 8l hello.8 $ ./8.out Hello, World