원문 :: http://hacks-web.blogspot.com/2009/11/ubuntugo.html
그냥 번역했습니다.
■ Ubuntu에서 GO Install 순서
vi .bashrc
# -------------------------------------
export GOROOT=$HOME/go
export GOBIN=$GOROOT/bin
export GOARCH=386
export GOOS=linux
export PATH=$PATH:$GOBIN
# -------------------------------------
source .bashrc
wget http://peak.telecommunity.com/dist/ez_setup.py
sudo python ez_setup.py
# apt-get install python-setuptools 이걸로도 가능할지도 (공식홈페이지는 이쪽)
# debian 모르겠음
sudo apt-get update
sudo apt-get install python-dev
sudo easy_install mercurial
# 소스코드 다운
hg clone -r release https://go.googlecode.com/hg/ $GOROOT
# 의존 라이브러리 인스톨
sudo apt-get install bison gcc libc6-dev ed make
cd $GOROOT/
mkdir bin
cd src
./all.bash
# 코드작성
vi hello.go
# -------------------------------------
package main
import "fmt"
func main() {
fmt.Printf("안녕하세요, 세계!")
}
# -------------------------------------
# X386계의 컴파일에서 컴파일
8g hello.go
# X386계의 링커에서 링커
8l hello.8
# 실행
./8.out
안녕하세요, 세계!
■ 참고URL
Ubuntu
http://babukuma.com/2009/11/ubuntugo.html
RedHat계
http://d.hatena.ne.jp/kidd-number5/20091111/1257939793
http://www.h-fj.com/blog/archives/2009/11/12-165449.php
댓글을 달아 주세요