結局触らずにいたけど
気づいたらGAEもGoogle Goに対応して
そろそろ触ってもいいかなーとか思いつつCentOSのマシンにインストール。
参考にしたページ
http://golang.org/doc/install.html
とりあえずGoのソースをfetchするためにmercurialをインストール
mercurialのインストール
yumではいらなかったからeasy_installで。どこ参考にしたっけ、適当にmercurial installとかでぐぐったらこういうのが出た。
$ yum install python python-devel python-setuptools $ easy_install mercurial
hgコマンドで動くのを確認。動くっぽい。
Goのインストール。
/usr/local/にでもインストールしよう。
$ cd /usr/local/ $ hg clone -u release https://go.googlecode.com/hg/ go $ cd go/src $ export GOROOT=/usr/local/go $ ./all.bash
Installed Go for linux/amd64 in /usr/local/go. Installed commands in /usr/local/go/bin. *** You need to add /usr/local/go/bin to your $PATH. ***
って書いてあるので、.zshrcに環境変数を追加
export PATH=$PATH:/usr/local/go/bin
6gは、amd64用のGoコンパイラ。file.6ってかんじで出力を吐く。amd64アーキテクチャなので、'6'。6g
is the Go compiler foramd64
; it will write the output infile.6
. The ‘6
’ identifies files for theamd64
architecture. The identifier letters for386
andarm
are ‘8
’ and ‘5
’. That is, if you were compiling for386
, you would use8g
and the output would be namedfile.8
.
386アーキテクチャ(i386、x86ってことですかね)は、'8'。armは'5'。
8gを使うときの出力は file.8、っといった具合。
6gとかpath通ってて動くっぽい。
で、Google Goがアップデートされたときは下記の感じで。
$ cd go/src $ hg pull $ hg update release $ ./all.bashHello Worldとかは眠いから明日やろう。
0 件のコメント:
コメントを投稿