Windowsã§ãgolang
golang-nutsãè¦ã¦ãããã¤ã15åã»ã©åã«ãDownload initial Windows port of go hereããªãã¦ããæ稿ããã£ãã®ã§æ©éè½ã¨ãã¦è©¦ãã¦ã¿ãã
- ã¾ã http://code.google.com/p/go-windows/ ãã go-1.zip ããã¦ã³ãã¼ããã¦è§£åãã¾ãã
- goãã£ã¬ã¯ããªãé©å½ãªå ´æï¼ããã§ã¯ã¨ããããC:\goï¼ã«ç½®ãã¦ä»¥ä¸ã®ããã«ç°å¢å¤æ°ãè¨å®ãã¾ãã
set GOROOT=C:\go set GOOS=mingw set GOARCH=386 set PATH=%PATH%;%GOROOT%\bin
- cmd.exeã§8gã¨æã¤ã¨ç¢ºãã«æ®éã«ä½¿ãããã§ãã
C:\Users\kawaz\Desktop\gotest>8g flags: -I DIR search for packages in DIR -d print declarations -e no limit on number of errors printed -f print stack frame structure -h panic on an error -k name specify package name -o file specify output file -S print the assembly language -w print the parse tree after typing -x print lex tokens
- hello.goãä½ã£ã¦â¦
package main func main() { println("Windowsã§ãGo!!"); }
- ã³ã³ãã¤ã«ï¼å®è¡ãã¦ã¿ã¾ããã
C:\Users\kawaz\Desktop\gotest>8g -o hello.8 hello.go C:\Users\kawaz\Desktop\gotest>8l -o hello.exe hello.8 C:\Users\kawaz\Desktop\gotest>hello.exe Windows縺ァ繧ã»o!!
- UTF-8ã§åºåãããããã§è¦äºã«æååãï½ï½
- cmd.exeã§UTF-8ã表示ã§ããããchcpã§ã³ã¼ããã¼ã¸ã65001(UTF-8)ã«å¤æ´ãã¦ãæ¹ãã¦å®è¡ã
C:\Users\kawaz\Desktop\gotest>chcp 65001 Active code page: 65001 C:\Users\kawaz\Desktop\gotest>hello.exe Windowsã§ãGo!!
- ä¸å¿åããã¨ã¯ç¢ºèªã§ãã¾ããï¼
goãã£ã¬ã¯ããªã®ä¸èº«ã§ãã bin ãã£ã¬ã¯ããªã®ä¸ã«ã¯ 6nm 8a 8c 8g 8l gopack ã ãã¨ããå¿
è¦æå°éã®ã³ãã³ãããããpkgãã£ã¬ã¯ããªãè¦ãã¨osãruntimeãfmtãªã©ã®åºæ¬çãªããã±ã¼ã¸ã¯å¤§ä½ç¨æããã¦ãããã§ãããhttp ããã±ã¼ã¸ãç¡ããªã©è¶³ããªãã¢ããã¾ã å¤ãããã§ãã