Goããã°ã©ãã³ã°ã«ã¤ãã¦ä¸æ©è¸ã¿è¾¼ãã ããã¦ã¼ã¹ã®è§£èª¬æ¸ãèªè ã¯ã·ã³ãã«ãªã³ã¼ããæ¸ããªãããå®éç¨ã¢ããªã±ã¼ã·ã§ã³ã®éçºã§ä½¿ãã¹ãã«ã¨ãã¯ããã¯ãå¦ã¶ãã¨ãã§ãã¾ããæ¬æ¸ã®ãµã³ãã«ããã°ã©ã ã¯ã©ããã·ã³ãã«ã§ããã¨ã¦ãå®è·µçã§ããæ¡å¼µæ§ã並è¡å¦çãé«å¯ç¨æ§ã¨ãã£ãã¨ã³ã¿ã¼ãã©ã¤ãºã¢ããªã±ã¼ã·ã§ã³ã®éçºã§ç´é¢ããç¾å®çãªåé¡ã«å¯¾ããã½ãªã¥ã¼ã·ã§ã³ãå«ã¾ãã¦ãã¾ããæ¬æ¸ãèªãã°ãå®éã®æ¥åã«å¿ è¦ãªæè½ââGoã«ããéçºææ³ããã³é¢é£æè¡ã®ä½¿ãæ¹ââããã¹ã¿ã¼ãããã¼ã«ãããã°ã©ã ã®éçºã¹ãã«ãè¿ éãã¤ç°¡åã«åä¸ã§ãã¾ããæ¥æ¬èªçã§ã¯ãç£è¨³è ã®éµé£¼æææ°ã«ããå·»æ«ä»é²ãGoãããã³ã¼ãã®æ¸ãæ¹ããåé²ãã¾ããã ãµãã¼ããã¼ã¸ï¼ãµã³ãã«ã³ã¼ããæ£èª¤è¡¨ï¼ ç£è¨³è ã¾ããã ã¾ããã 1ç« ãWebSocketã使ã£ããã£ããã¢ããªã±ã¼ã·ã§ã³ 1.1ãã·ã³ãã«ãªWebãµã¼ãã¼ 1.1.1ããã³ãã¬ã¼
go.mobileããã±ã¼ã¸ãå©ç¨ãã¦ã¿ãã®ã§ãç°å¢æ§ç¯ãªã©ã®ã¡ã¢ãæ¸ãã¾ããã Go 1.4ã§Androidããµãã¼ããããã¨ã«ã ç§ã¯Goã¨Androidã¯ç¸æ§ãæªãã®ã§å ¥ããªãã ããã¨æã£ã¦ããã®ã§ãããGo1.4ã§å ¥ãã¦ãã¾ããã ããã§ãåä½ç¢ºèªãããã¨ãããã£ããåä½ãã¦ãNexus 5ä¸ã«Deployãã§ããã®ã§è¨äºãæ¸ãã¦ãããã¨æãã¾ãã ç°å¢æ§ç¯ãããããã¤ã¾ã§ã®æé 詳細ãé£ã°ãããæ¹ã¯æé ãè¦ã¦é²ãã¦ä¸ãããã¡ãªã¿ã«ç¢ºèªããç°å¢ã¯MacOSX 10.9.5ã§ãã go get code.google.com/p/go.mobile 2. (2014/11/22追è¨) å ¬å¼ãµãããã±ã¼ã¸ãå¤æ´ã«ãªãé¢ä¿ã§golang.org/x/mobileã¨ãããªãã¸ããªã«å¤ããã¾ãã 3. (2014/11/22追è¨) go get golang.org/x/mobile ã§ãå¯
ãªããããä¸é¨ã«è£è¶³ããã¦ããã®ã§ã念ã®ãã軽ã説æãã¦ããã¾ãã masahiro nagano@kazeburoææã®lestrratããã®golangãªã¢ããªã¯hot-deployãå¯è½ã«ãªã£ã¦ãããµã¼ãã¯server_starterçµç±ã§èµ·åããã¦ãã¦ããã¤ããªæ¶ãã¦HUPãéãã¨èªåã§ãã«ãããªããã¦ããã»ã¹ãå ¥ãæ¿ãã¦ããããä¾¿å© 2014/04/30 12:18:31 ããããã¹ããªæ¹æ³ã ã¨ã¯æã£ã¦ããªããã ãã©ãæåã«ãããæ¸ããå½æã®èãæ¹ã¯ä»¥ä¸ã®éãï¼ ããã¯èªåã®é¨ç½²ã§åã㦠æ¬çªã«è¨ç½®ããgoã¢ããªã§ããä¸æ¬¡å¯¾å¿ããã人ã¯èªåã¨ã¯éããªãç´°ããã³ã¼ãå 容ã®ä¿®æ£ã¯ã¨ããããæãããªãã°ã£ã½ããã®ã®ä¿®æ£ï¼ä¾ï¼SQLæã®å¤æ´ï¼ãªã©ãèªå以å¤ã®äººéãæ½ããå¾ã«ãµã¼ãã¼ãç°¡åã«åã³ã³ãã¤ã«ï¼åèµ·åããããæ¹æ³ããªãã¨æ¤ åãéã£ã¦ããäºã容æã«äºæ³ããã Apache::Log
tl;dr: å¥ã«Perlæ¨ã¦ã¦ãªãã§ããPerl大好ãã俺ã¯LLã¯Perlã§ãããã§ãå¥ãã¡ã¤ã³ã®äºããã£ã¦ãããããï¼ Rebuild.fmã«éãããå ¬ã®å ´ã§YAPC/Perl以å¤ã®è©±ãããäºãããã¨ã¯æ£ç´æã£ã¦ããªãã£ããããã®ãã³Rebuild.fm ep 42ã«ç½®ãã¦ï¼æéGoã«ã¤ãã¦ããã¹ãã¾ãã£ã¦ããã1æéã¶ã£ã¤ãæ¬çªã§ããã¹ãããäºã¯ã ãããããã¹ã£ã¦ããã®ã ãã©ããã®å¾ã®ãã£ã¼ãããã¯çããµã¾ãã¦ã¾ã¨ãã¦ããããã¨æã£ãã®ã§ãã®ã¨ã³ããªã§ã¾ã¨ãã¦ã¿ã¾ã Goäºå§ã ãããããªãã§ããã¾ã§Goãã¬ãªã¬ãªæ¸ãåºããã®ãã æ£ç´è¦ªç¶ã®ã£ã°ã¨vimã§æåãªãã®äººããGoãããï¼ãã¨è¨ãåºããã¨ãã«ã¯Goã«å¯¾ãã¦ã¯ããããããå°è±¡ãããªãã¦ç¹ã«æ³¨æãããã¦ãªãã£ããã ãã©ãããããéãè¨èªã¨ãã¡ã¤ã³ã«åãã¦ã¿ããã¼ã¨æã£ã¦æ¢ãã¦ããæã«ããã俺ããLLç³»ã®è¨èªå¥ã«ãããªããªãã¨ãµ
ãã®ã¨ããæ ç±ãçããã¦ãã go-xslate ããã¸ã§ã¯ãã§ããã大å使ããããã«ãªã£ã¦ããããããªãã®å¦çé度ãåºãããã«ãªã£ãããgo-nutsã§å®£ä¼ãããããå°ããããã¸ã§ã¯ãã§ä½¿ãå§ãããã»ã»ã»ã£ã¦ãã¨ã§ æ軽ã«éã¹ãç¨ã« Go Playgroundãã±ãã£ã¦Go-Xslate Playgroundã£ã¦ã®ãæ¸ããã å¤é¨ãã³ãã¬ã¼ãã使ãWRAPPERãINCLUDEã¯ä½¿ããªããã©ããã以å¤ã®æ©è½ã¯ä¸éã使ããã¯ããæ¯ééãã§ã¿ã¦ãåé¡ãããããã ã£ãã "Share"ãã¿ã³ãæ¼ãã¦permalinkãä½æã®ä¸ãpermalinkãissueã«ã¯ãã¤ãã¦æãã¦ãã ããããããããé¡ããããã¾ãã ã¡ãªã¿ã«æ¸ãããã°ãã mattnããã«ã±ãããããã©ãèªåãã±ãã£ã¦ãããã±ããããã®ã¯è¯ãç©ãæ¸ãããããªã®ã§ã¤ã¾ãå ¨ä½çã«å¤§å¤ããããªãGo-Xslate Playgroundèª
ãã¾ãé«éãã¿ã¼ã³æ¤ç´¢ã¨ããã°ag(The Silver Searcher)ã§ãããæ¤ç´¢å¯¾è±¡ãUTF-8ã®ããã¹ããåæã¨ãã¦ãããããEUC-JPãShift-JISã¨ãã£ããã¡ã¤ã«ãæ¤ç´¢ããã®ã«èª²é¡ãããã¾ãã ããã¾ã§ããããã®æ¥æ¬èªæåã»ãããæ¤ç´¢ã§ããããã«ãããããè²ã ã¨agã®æ¹é ãå ¬éãè¡ã£ã¦ãã¾ããã ag(The Silver Searcher)ã§EUC-JP/Shift-JISã®ãã¡ã¤ã«ãæ¤ç´¢ã§ããããã«ãã¦ã¿ã æ¥æ¬èªåç¹ååag -ç½é- ã®é åãå®äºãã¾ãã ããããç¹å®ã®å½ã®æåã³ã¼ãã ãã«ç¹åããä¿®æ£ã¨ããã®ãmasterã«åãè¾¼ãã§ãããããã«ãããããæ´¾çãã©ã³ãã¨ãã¦è¿½éããã®ãããã¯ãé¢å⦠ããã§å¹´å§ã«Goè¨èªã触ã£ãã®ããã£ããã«ãGoè¨èªã§ãã¿ã¼ã³æ¤ç´¢ãã¼ã«ãã¤ãã£ã¦ã¿ã¾ããã ãã£ãããªã®ã§ãã¹ãagãç®æãã¦ããã©ãããµã¼ãã£ã¼(The Pl
goè¨èªã®åå¼·ã«ãmotemenãããä½ã£ãhtmlcat(æ¨æºå ¥åããã©ã¦ã¶ã§ tail -f ã§ãã htmlcat ã¨ããã®ãæ¸ãã - NaN days - subtech)ãgoã§å®è£ ãã¦ã¿ã¾ããããã®è¨äºã§ã¯htmlcatgoã®ç´¹ä»ã¨å®è£ ã®è¦ã©ããã«ã¤ãã¦è§£èª¬ãã¾ãã htmlcatgoã®ç´¹ä» htmlcatgo ã¯ãæ¨æºå ¥åããã©ã¦ã¶ä¸ã§tail -fã§ããã½ããã¦ã§ã¢ã§ããå ç¥htmlcatã®ä½¿ãæ¹ã¨ã»ã¼ä¸ç·ã§ãã $ tail -f /var/log/messages | htmlcatgo ã®ããã«å®è¡ããã¨ã 2013/12/16 08:15:02 htmlcatgo: http://localhost:45273ã®ããã«URLã表示ããã¾ããããããã©ã¦ã¶ã§è¡¨ç¤ºããã¨ãç»é¢ã«tail -fã®çµæããªã¢ã«ã¿ã¤ã ã§æµãã¦ãã¾ããå ç¥htmlcatã«ãã --execãªã
Goã® cgo ã¨ããæ©è½ã使ãã¨ãGoããCã®ä¸çã®ã³ã¼ããå¼ãã ããå¼ã°ããããããã¨ãã§ããã Perlã§è¨ãã¨ããã®XSã¨ãããã¤ã ã ãã®cgoã使ã£ãGoããã°ã©ã ã¯ãæã¯Makefileãå©ç¨ãã¦ãã«ããã¦ããããã ãã 1.0ãã㯠go get ã go build ã¨è¨ã£ããgo toolãcgoã«å¯¾å¿ããã®ã§ãããããã¨ãå¿ è¦ãªããªã£ã¦ããã cgoã®åºæ¬çãªä½¿ãæ¹ ã¾ã㯠import "C" ã¨ãã¦ãCã¨ããçä¼¼ããã±ã¼ã¸ãimportããã ãã®ããã±ã¼ã¸ã使ãã¨ã C.fprintf(...) ã¨ãããããªæãã§Cã®ä¸çã«ã¢ã¯ã»ã¹ã§ããããã«ãªãã ã¾ãããã®importæã®ç´åã®ã³ã¡ã³ãã¯Cã®ã³ã¼ãã¨ãã¦è§£éãããã ãªã®ã§ã package main /* #include <stdio.h> void hello() { fprintf(stderr,
GO Essential A list by Andrea Di Persio, 11 Nov 2013 A collection of resources for programmers trying GO for the first time. GO language is a clean and modern programming language, mixing elements from C, Python, and more exotic languages like Limbo. On top of that, GO offers a sane approach to concurrency, so you'll never have to worry about locks, mutex and other nightmarish construct, and a nic
isucon3ã¹ã¿ããã¨ãã¦æ¬é¸éå¶ã®ãæä¼ãããã¦ãã¾ããããåå è ã§ã¯ãªãã®ã§isuconã«ã¤ãã¦ç¹ã«æ¸ããã¨ãè¦ã¤ãããªãmix3ã§ããä¸ã¤è¨ããã®ã¯ã¿ããªåããã§ããã«æ¯ã¹ã¦èªåã¯æ¬å½ã«ãªã«ãåºæ¥ãªãç¡è½ãªãã ãªãã¨åèªèããããã¾ãããæ»ã«ããã 移æ¤ãå¼ãåãã話 isuconã§ã¯æåã«åãç¶æ ã®ã¢ããªãç¨æãããã®ã§ããããã®ã¢ããªã¯åé¡ã確å®ããå¾ã«ã¾ããªãã¡ã¬ã³ã¹å®è£ ï¼ä»åã¯Perlï¼ãããããã®å¾äºé¸ãæãã人ãã¡ã使ç¨ãã¦ããè¨èªï¼Perlå«ãRuby,Python,PHP,NodeJS,Goï¼ã«ç§»æ¤ãããã¨ããæµãã§ä½ããã¾ãããèªåã¯ãã®ä¸ã§Goè¨èªç§»æ¤ãæ å½ãã¾ããã ã¡ãªã¿ã«Perl以å¤ã®ç§»æ¤è¨èªã®ä¸ã§ã¯PHPããããã触ã£ããã¨ããªããPHPãããããï¼,ï¼å¹´ã¯è§¦ã£ã¦ããããã£ããå¿ãã¦ãã¾ã£ã¦ãã®ã§ãä½ã®è¨èªãæ å½ãããã¨ä½ãåãããªãç¶æ ããå§ã¾ãã¨ãã
ã«ã¬ã³ããã¡ã¤ã«ã®ãã¡ã¤ã«åããã£ã¬ã¯ããªåãç¥ããã runtime.Callerãå©ç¨ããstackã®è¿ãå¤ãå©ç¨ããã°è§£æ±ºã§ãããã¨ããã®ã ã°ã¼ã°ã«å çã§æ¤ç´¢ãã¦ç¥ã£ãã å ã½ã¼ã¹ https://gist.github.com/abrookins/2732551#file-gistfile1-go code snippet import ( "runtime" "path" ) // __FILE__ func GetCurrentFile() string { _, filename, _, _ := runtime.Caller(1) return filename } // __DIR__ func GetCurrentDir() string { _, filename, _, _ := runtime.Caller(1) return path.Dir(filename
Go ã¯ãããã¯ã¼ã¯ã¢ããªã±ã¼ã·ã§ã³ãæ軽ã«æ¸ããè¨èªã§ãããä¾ãã° 80 çªãã¼ããªã©ã root ã§ãã bind ã§ããªãã¢ãã¬ã¹ã Listen ããã¢ããªã±ã¼ã·ã§ã³ãã root ã§ãªãã¦ã¼ã¶ã¼ã§åããã®ã¯å°å³ã«é¢åã§ãã æ®éã¯ã½ã±ããã bind ãã¦ãã setuid/setgid ããã®ã§ããã Linux ã§ã¯ setuid ãå¼ã³åºããã¹ã¬ããããé©ç¨ãããªãã¨ããåé¡ãããã Go ã¨ã®ç¸æ§ãæªãããã§ãã åè 対å¦æ¹æ³ã¨ãã¦ã Linux ã§ã¯ capabilities ã使ã£ã¦é root ã¦ã¼ã¶ã¼ã§ã 1024 çªä»¥ä¸ã bind ã§ããããã«ãã Mac OS X ãªã©ã§ã¯ bind ãã¦ãã setuid ããããã«ããã å ã« root 㧠bind ããã½ã±ããã Go ã®ããã°ã©ã ã«æ¸¡ãã 2çªãã®æ¹æ³ã使ããµã³ãã«ããã°ã©ã ãæ¸ãã¦ããã¾ã. $
é·ãã®ã§çµè«ã ãå ã«ã BDD風å³ã«éåæãç¡ããªããGinkgoããªã¹ã¹ã¡ã ãã£ã¨è»½ãã¦ã·ã³ãã«ãªã®ãè¯ããªããTestifyããªã¹ã¹ã¡ã ãã¹ã対象ã¨ãªãã³ã¼ã å ¬å¼ã®How to Write Go CodeããYour first libraryã«ããã³ã¼ããæã£ã¦ãã¾ãã package go_testing // Sqrt returns an approximation to the square root of x. func Sqrt(x float64) float64 { z := 1.0 for i := 0; i < 1000; i++ { z -= (z*z - x) / (2 * z) } return z } æ¨æºã§çµè¾¼ã¾ãã¦ãããã¹ãç¨ã©ã¤ãã©ãªã«ã¤ã㦠testing.* å®ç¨æ§ã¯ç¢ºãã«ãã£ã¦å¿ è¦ãªãã®ã¯æã£ã¦ãæããã®ã ãã©ãåã«ã¯ããã°ããã®è¾ã¿ãã
ç»åå¨ãã®åä½ãæå³ä¸æãã¤ä½¿ãè¾ãã®ã§ç§»è»¢ãã¾ããã goè¨èªã®ãã¹ãã£ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã«ã¤ã㦠â ãã«ããã
Goè¨èªã¯ gdbã§ã®ãããã°ããµãã¼ãããã¦ãã ã®ã ããOS X ã§ããã使ããã¨ãããããããç½ ã«ã¯ã¾ã£ãã®ã§ããã«è¨ãã¦ããã (ãã®ã¨ã³ããªå·çæã®æå ã®ç°å¢ã¯ OS X 10.9(.0) Mavericks + Xcode 5.0.1) ç½ ä¸è¦§ OS X ä»å±ã®gdbãå¤ã Xcode 5.0.1ã®clangã ã¨gdbã®ãã«ããããã ãã«ãããgdbã¯python2ã«ãªã³ã¯ãããªãã¨Goä»å±ã®runtime-gdb.pyãåããªã[1] ãã«ãããgdbã«ã³ã¼ãç½²åãããªãã¨ä»ããã»ã¹ãã¢ã¿ããã§ããªã OS X ä»å±ã®gdbãå¤ã Goã®ã³ã¼ããgdbã§ãããã°ããã«ã¯ãgdb 7.1以ä¸ãå¿ è¦ã¨ãããã¨ã ããOS X (Xcode?) ä»å±ã®gdbã¯å¤ãã¦ä½¿ããªãã æå ã®ãã¼ã¸ã§ã³ã¯ GNU gdb 6.3.50-20050815 (Apple version gdb-
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}