8g ã¨ã 6l ã¨ãã®ã³ãã³ãã (åããã«ãã|æã¡ã¥ãã) ã¨ãããã¨ã«å®è©ã®ãã Go ã§ãããããã±ã¼ã¸ãä½ããããªå ´å㯠Makefile ãこんな風にæ¸ã㨠make ä¸çºã§ãã¨ãæ¸ãã®ã§ç°¡åã§ããvia http://blog.yappo.jp/yappo/archives/000697.html
ã§ãã¡ãã£ã¨ãã code snippet ã試ãã®ã« Makefile ãç¨æããã®ãé¢åã ããã¨ãããã¨ã§ãããªãã£ã¤ã wrapper ãäºã¤æ¸ãã¾ããã
gorun http://gist.github.com/239255 å¼æ°ã«ä¸ããã½ã¼ã¹ã complie, link, å®è¡ãã perl script.
$ cat hello.go package main import "os" func main() { arg := os.Args[1]; os.Stdout.WriteString("Hello " + arg + "\n"); } $ gorun hello.go world Hello world
ä¸çºã§å®è¡ã¾ã§ã§ãã¾ãã
[2009-11-20 追è¨] æåã® shell script çã¯ã³ãã³ãã©ã¤ã³å¼æ°ã®æ±ãã«åé¡ããã£ãã®ã§ perl ã§æ¸ãç´ãã¾ãã
goshell http://gist.github.com/236967 ãããã«ã¤ã³ã¿ã©ã¯ãã£ã shellãã¨ããããã«ã¯ãããªããã©ããã½ã¼ã¹ã³ã¼ãããã¡ã¤ã«ã«æ¸ããªãã§å
¥åãã¦ãã£ã¦ããã®ã¾ã¾å®è¡ã§ããã
# gosh 㯠Gauche ã®ã³ãã³ããªã®ã§â¦â¦
- \run compile, link, å®è¡
- \list ç¾å¨å ¥åããã¦ããã½ã¼ã¹ã³ã¼ãã表示
- \clear å ¥åãããã½ã¼ã¹ãåé¤
- \quit çµäº
packege main ã¯èªåã§å ¥ãã¾ãã
$ goshell import "fmt" func fib(n int) int { if (n <= 2) { return 1 } return fib(n - 2) + fib(n - 1); } func main() { fmt.Printf("fib(30)=%d\n", fib(30)); } \list ---- package main import "fmt" func fib(n int) int { if (n <= 2) { return 1 } return fib(n - 2) + fib(n - 1); } func main() { fmt.Printf("fib(30)=%d\n", fib(30)); } ---- \run fib(30)=832040 \quit