Golangã£ã¦ãã¼ã¯ã¼ããããã®ããªãããã
http://golang.org/
ã¾ãã¯
$GOROOTã$GOOS ã$GOARCHãè¨å®ããã¨ãããã¨ã§ãè¨å®ã
export GOROOT=$HOME/go export GOOS=linux export GOARCH=386
Mercurialã®ã¤ã³ã¹ãã¼ã«ãã§ãããã¯Python-develãå
¥ã£ã¦ããªãã¨ãã¡ã
$ sudo easy_install mercurial
ã¯ãæ»äº¡ã
mercurial/base85.c:12:20: error: Python.h: No such file or directory mercurial/base85.c: In function âb85prepâ: mercurial/base85.c:23: warning: implicit declaration of function âmemsetâ mercurial/base85.c:23: warning: incompatible implicit declaration of built-in function âmemsetâ mercurial/base85.c: At top level: mercurial/base85.c:28: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token mercurial/base85.c:76: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token mercurial/base85.c:141: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âmethodsâ mercurial/base85.c:150: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âinitbase85â error: command 'gcc' failed with exit status 1
ã¦ãã¨ã§ã
$ sudo yum -y install python-devel
ã¾ãMercurialã¯ã©ãã§ãããããããªã¨ããã§ã³ã±ã¦ãå ´åãããªãã
$ hg clone -r release https://go.googlecode.com/hg/ $GOROOT
ãããã
$ sudo apt-get install bison gcc libc6-dev ed
ã¨ãæ¸ãã¦ãããããã£ã¨æ©ãè¨ããã
ã¦ãªããã§
$ yum -y install bison gcc libc6-dev ed
ãã®ã¾ã¾
$ cd $GOROOT/src $ ./all.bash
$GOBIN is not a directory or does not exist create it or set $GOBIN differently
To build the Go distribution, make sure $GOBIN (or $HOME/bin if $GOBIN is not set) is in your $PATH and then run
ãã¼ãã¼PATHéãã®ãæ©ãè¨ã£ã¦ã
export GOROOT=$HOME/go export GOOS=linux export GOARCH=386 export GOBIN=$HOME/go/bin PATH=$PATH:$GOBIN
ãã£ã¬ã¯ããªããªãã¨ãããªããããã
$ . ~/.bashrc $ mkdir $GOBIN $ ./all.bash --- FAIL: os_test.TestRemoveAll RemoveAll "_obj/_TestRemoveAll_" succeeded with chmod 0 subdirectory?(extra *os.PathError=lstat _obj/_TestRemoveAll_: no such file or directory) FAIL make[1]: *** [test] Error 1 make[1]: Leaving directory `/root/go/src/pkg/os' make: *** [os.test] Error 2
ãã³ã¼ãããªãã
ããã¦åãã¡ãã»ã¼ã¸ã§ããã£ã¦ãããªãè¦ã¤ããã
http://code.google.com/p/go/issues/detail?id=22
ããã«ãã³ã¼ãã
ã¨ããããã§ä¸è¬ã¦ã¼ã¶ãä½ãã
# useradd ito # su - ito
ãã£ãã.bashrcãè¨å®ãã¦ããã
$ ./all.bash ï¼ç¥ï¼ --- cd ../test 0 known bugs; 0 unexpected bugs
ãã¿ã³ã¬ï¼
ããã°ã©ã ãæ¸ã
$ cat >hiromi.go <<EOF > package main > import "fmt" > > func main() { > fmt.Printf("Hello, Japan\n") > } > EOF
ã³ã³ãã¤ã«ãã¦å®è¡ï¼
$ 8g hiromi.go $ 8l hiromi.8 $ ./8.out Hello, Japan
ã¸ã£ãã¼ã¼ã³ï¼
gccã¿ãããªåºåãã¡ã¤ã«ã®æå®ã®å ´åã
$ 8l -o japan hiromi.8 $ ./japan Hello, Japan