<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>zaru blog &#187; プログラミング_Go</title>
	<atom:link href="http://zaru.tofu-kun.org/category/%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0_go/feed/" rel="self" type="application/rss+xml" />
	<link>http://zaru.tofu-kun.org</link>
	<description>Web系のこととかー。</description>
	<lastBuildDate>Fri, 18 Nov 2011 02:28:49 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://zaru.tofu-kun.org/category/%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0_go/feed/" />
		<item>
		<title>新プログラミング言語「Go」をCentOSにインストールしてみた</title>
		<link>http://zaru.tofu-kun.org/2009/11/11/%e6%96%b0%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0%e8%a8%80%e8%aa%9e%e3%80%8cgo%e3%80%8d%e3%82%92centos%e3%81%ab%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97/</link>
		<comments>http://zaru.tofu-kun.org/2009/11/11/%e6%96%b0%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0%e8%a8%80%e8%aa%9e%e3%80%8cgo%e3%80%8d%e3%82%92centos%e3%81%ab%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 04:43:44 +0000</pubDate>
		<dc:creator>zaru</dc:creator>
				<category><![CDATA[プログラミング_Go]]></category>

		<guid isPermaLink="false">http://zaru.tofu-kun.org/?p=35</guid>
		<description><![CDATA[Googleから新プログラミング言語「Go」がリリースされて、LinuxとMacに対応しているっていうことで、早速ものは試しでCentOSに入れてみた。 １：バージョン管理ツール「Mercurial」をインストール CentOSにMercurialが入っていなかったので、インストール。まず、easy_installコマンドが欲しかったので先にpython-setuptoolsをインストールする。 #yum install python-setuptools #easy_install mercurial これで、Mercurialが使えるようになった。 ２：環境変数を設定 $GOROOT／$GOOS／$GOARCH／$GOBINを設定する。とりあえず、ホームディレクトリに「bin」ディレクトリを作っておく。 $cd;mkdir bin $export GOROOT=$HOME/go $export GOOS=linux $export GOARCH=386 $export PATH=$PATH:$HOME/bin $source .bashrc ３：Goをリポジトリから入手 $hg clone -r release https://go.googlecode.com/hg/ $GOROOT ４：Goをインストール $cd ./go/src $./all.bash マシンによってはちょっと時間がかかるかも。5分くらい？最後に &#8212; cd ../test N known bugs; 0 unexpected bugs って出ればOK。これでGoのインストールは完了。 ５：Hello Worldしてみる ホームディレクトリに作ったbinの中にバイナリが設置されているはず。386を選択した場合は、8gとか8lとかがある。（amd64の場合は6g、6lらしい） $ cat &#62;hello.go &#60;&#60;EOF package main import [...]]]></description>
			<content:encoded><![CDATA[<p>Googleから新プログラミング言語「Go」がリリースされて、LinuxとMacに対応しているっていうことで、早速ものは試しでCentOSに入れてみた。</p>
<p><strong>１：バージョン管理ツール「Mercurial」をインストール</strong></p>
<p>CentOSにMercurialが入っていなかったので、インストール。まず、easy_installコマンドが欲しかったので先にpython-setuptoolsをインストールする。</p>
<pre class="brush: bash; title: ;">
#yum install python-setuptools
#easy_install mercurial
</pre>
<p>これで、Mercurialが使えるようになった。</p>
<p><strong>２：環境変数を設定</strong></p>
<p>$GOROOT／$GOOS／$GOARCH／$GOBINを設定する。とりあえず、ホームディレクトリに「bin」ディレクトリを作っておく。</p>
<pre class="brush: bash; title: ;">
$cd;mkdir bin
$export GOROOT=$HOME/go
$export GOOS=linux
$export GOARCH=386
$export PATH=$PATH:$HOME/bin
$source .bashrc
</pre>
<p><strong>３：Goをリポジトリから入手</strong></p>
<pre class="brush: bash; title: ;">
$hg clone -r release https://go.googlecode.com/hg/ $GOROOT
</pre>
<p><strong>４：Goをインストール</strong></p>
<pre class="brush: bash; title: ;">
$cd ./go/src
$./all.bash
</pre>
<p>マシンによってはちょっと時間がかかるかも。5分くらい？最後に<br />
&#8212; cd ../test<br />
N known bugs; 0 unexpected bugs<br />
って出ればOK。これでGoのインストールは完了。</p>
<p><strong>５：Hello Worldしてみる</strong></p>
<p>ホームディレクトリに作ったbinの中にバイナリが設置されているはず。386を選択した場合は、8gとか8lとかがある。（amd64の場合は6g、6lらしい）</p>
<pre class="brush: bash; title: ;">
$ cat &gt;hello.go &lt;&lt;EOF
package main
import &quot;fmt&quot;
func main() {
 fmt.Printf(&quot;ハロー、世界！\n&quot;)
}
EOF
$ 8g hello.go
$ 8l hello.8
$ ./8.out
ハロー、世界！
$
</pre>
<p>はい。無事にできました。とりあえずどんな言語か全くリファレンスを見ていないので分からないけど。</p>
<p>６：追記</p>
<p>コンパイルした後の8.outのファイルサイズは560KB。けっこう重いなー。</p>
<p>それと、MacOSX 10.6.2にもインストールしてみた。すんなり入った。色々と試してみようかな。</p>
<img src="http://zaru.tofu-kun.org/?ak_action=api_record_view&id=35&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://zaru.tofu-kun.org/2009/11/11/%e6%96%b0%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0%e8%a8%80%e8%aa%9e%e3%80%8cgo%e3%80%8d%e3%82%92centos%e3%81%ab%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://zaru.tofu-kun.org/2009/11/11/%e6%96%b0%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0%e8%a8%80%e8%aa%9e%e3%80%8cgo%e3%80%8d%e3%82%92centos%e3%81%ab%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97/" />
	</item>
	</channel>
</rss>
