ãã®è¨äºã¯ The Go Blog - Using Go Modules ã®å訳ã§ãã ã¯ããã« Go 1.11ããã³1.12ã«ã¯ãä¾åãã¼ã¸ã§ã³æ å ±ãæ示çã§ç®¡çãããããããGoã® æ°ããä¾å管çã·ã¹ãã ã§ãã ã¢ã¸ã¥ã¼ã« ã®äºåãµãã¼ããå«ã¾ãã¦ãã¾ãããã®ããã°è¨äºã¯ãã¢ã¸ã¥ã¼ã«ã使ãå§ããããã«å¿ è¦ãªåºæ¬çãªæä½ãç´¹ä»ãããã¥ã¼ããªã¢ã«ã§ãããã®æ¬¡ã®è¨äºã§ã¯ãä»ã®äººã使ç¨ããããã®ã¢ã¸ã¥ã¼ã«ã®ãªãªã¼ã¹æ¹æ³ã«ã¤ãã¦èª¬æãã¾ãã ã¢ã¸ã¥ã¼ã«ã¯ããã®ã«ã¼ãã« go.mod ãã¡ã¤ã«ãæã¤ãã¡ã¤ã«ããªã¼ã«æ ¼ç´ããã Goããã±ã¼ã¸ ã®éã¾ãã§ãã go.mod ãã¡ã¤ã«ã¯ãã¢ã¸ã¥ã¼ã«ã®ã¢ã¸ã¥ã¼ã«ãã¹ï¼ã«ã¼ããã£ã¬ã¯ããªã«ä½¿ç¨ãããã¤ã³ãã¼ããã¹ï¼ã¨ãã®ä¾åé¢ä¿ã®è¦ä»¶ï¼ãã«ããæåãããããã«å¿ è¦ãªä»ã®ã¢ã¸ã¥ã¼ã«ï¼ãå®ç¾©ãã¾ããåä¾åé¢ä¿ã®è¦ä»¶ã¯ãã¢ã¸ã¥ã¼ã«ãã¹ã¨ç¹å®ã® ã»ãã³ãã£ãã¯ã
ã¯ããã« ã¾ãå§ãã«è¨ã£ã¦ãããªããã°ãªãã¾ããã gocode ä»ã¾ã§æ¬å½ã«ãããã¨ã ãã®è¨äºã¯ãGo è¨èªæ´10å¹´ã«ãªãåãããã¾ã§æç¨ãã¦ãã Go è¨èªã®ã³ã¼ãè£å®ã½ããã¦ã§ã¢ gocode ã®æ´å²ã¨å績ãããã¦ä»ãgocode èªãããã®å½¹å²ãçµãããã¨ãã¦ãã姿ããã²çããã«ç¥ã£ã¦é ãããã¨ããæããã Go Advent Calendar 2018 ã®è¨äºã¨ãã¦èµ·ããã¾ããããã®è¨äºã§ã¯ gocode ãæ©ãã§ããæ´å²ã¨è¦æ©ãå°ãã§ãçããã«åããæ§ã«è§£èª¬ããã¦é ãã¤ã¤ãããã¦æ¬¡ã«ãã£ã¦ãã Go è¨èªã®ã³ã¼ãè£å®ã®æªæ¥ã«ã¤ãã¦ãç´¹ä»ãããã¨æãã¾ããVim ã«ã¤ãã¦å¤ãã«æ¸ããã¦ãã¾ãããVisual Studio Code ã§ã® Go éçºã«ãå½±é¿ãã話ã§ãã gocode ã¨ã¯ gocode 㯠nsf æ°ãéçºãã Go è¨èªã®ã³ã¼ãè£å®ãµã¼ãã§ãã GitHub
Go è¨èªã³ã³ãã¤ã©ã®ãã¼ã¸ã§ã³ 1.11ããæè¼ããããã¢ã¸ã¥ã¼ã«å¯¾å¿ã¢ã¼ããã ãï¼å°ã試ãã¦ã¿ã¦ãããªãã«ä½¿ããããªã®ã§ï¼ãã®è¨äºã§ããç¨åº¦ã¾ã¨ãã¦ãããã¨ã«ããã ãããããä½ãããã°ãã®è¨äºã«å çã»ä¿®æ£ãã¦ããäºå®ã§ããã ãªãï¼ã¢ã¸ã¥ã¼ã«å¯¾å¿ã¢ã¼ã㯠1.11 æç¹ã§ preliminary support ã«éããªãããï¼ä»¥éã®ãã¼ã¸ã§ã³ã§å¤§ããªå¤æ´ãè¡ããããããããªãã ãããã£ã¦ãã®è¨äºã¯ãã¼ã¸ã§ã³ 1.12 以éã§å¤§å¹ ã«æ¸ãæ¿ããå¯è½æ§ããã ç¨èªã®æ´ç ã¾ãæåã«ç¨èªã®å®ç¾©ããã¦ããã GOPATH ã¢ã¼ãã¨ã¢ã¸ã¥ã¼ã«å¯¾å¿ã¢ã¼ã ãã¼ã¸ã§ã³ 1.11 以éãã㯠Go è¨èªã³ã³ãã¤ã©ã¯ä»¥ä¸ã®2ã¤ã®ã¢ã¼ãã®ã©ã¡ããã§åä½ãã1ã GOPATH ã¢ã¼ã (GOPATH mode) : ãã¼ã¸ã§ã³ 1.10 ã¾ã§ã®åä½ã¢ã¼ããæ¨æºã©ã¤ãã©ãªãé¤ãå ¨ã¦ã®ããã±ã¼ã¸ã®ç®¡çã¨ãã«
ä¼ç¤¾ã®Blogã«ãæ¸ããã®ã§ãããISUCON 8 äºé¸ã§è² ãã¦ãã¾ããã ãã¦ã ISUCON ã®åæå®è£ ã®å®çªã¨ãã¦ãåå¿è ãæ¸ãããããªSQLãã³ã¼ãã«ãªã£ã¦ããç¹ãæãããã¾ãã ä»åã® Go ã®åæå®è£ ããã®å®çªã«ããããåå¿è ããããã¡ãªãGoã®è¯ãã殺ãã¦ãã¾ãã³ã¼ããããã¾ããã ä»åè² ããåçç¹ã®ä¸ã¤ã¨ãã¦ãã¢ããªã®æ¸ãæããäºäººã§ãã£ã¦ããã®ã§ã³ã³ããªã¯ããæãã¦ãã®ãªãã¡ã¯ã¿ãªã³ã°ãæ ã£ãã¨ããã®ãããã¾ãã Goã§æ¬æ¦ã«åå ããããã¼ã ã®æ¹ã«ã¯ãã²ãããå æãã¦ãããããã¨æãã¾ãã ã¢ã³ããã¿ã¼ã³: é·ãç¡åé¢æ° ä¾: https://github.com/isucon/isucon8-qualify/blob/9d7890f5433bdaf2cec75b4cdf1ebd0d9a531281/webapp/go/src/torb/app.go#L404-L492
1ã¶æãåã®è©±ã§ç³ã訳ãªããï¼å ææ«ã« Go è¨èªã³ã³ãã¤ã© 1.11 ããªãªã¼ã¹ãããã Go 1.11 is released - The Go Blog Go 1.11 Release Notes - The Go Programming Language 主ãªå¤æ´ç¹ã¯ä»¥ä¸ã®2ã¤ã WebAssembly ã¸ã®ã³ã³ãã¤ã«ããµãã¼ã ãã¢ã¸ã¥ã¼ã«ãæ©è½ã®å®é¨çãµãã¼ã ãã®ãã¡ï¼ä»åã¯ãã¢ã¸ã¥ã¼ã«ãæ©è½ã®ãµãã¼ãã«ã¤ãã¦ç°¡åã«ç´¹ä»ããã ãã¢ã¸ã¥ã¼ã«ãã¨ã¯ï¼ããã¾ã§ vgo (Versioned Go) ã¨ãã¦éçºãé²ãããã¦ãããã®ã§ vgo (Versioned Go) ã«é¢ããè¦ãæ¸ã ãã®ææãæ£å¼ã«çµã¿è¾¼ã¾ããã ãã¼ã¸ã§ã³ 1.11 ã§ãã¢ã¸ã¥ã¼ã«ãæ©è½ãæå¹ã«ããã«ã¯ç°å¢å¤æ° GO111MODULE ã on ã¾ã㯠auto ã«ã»ããããã ã¡ãªã¿ã«ï¼ç°å¢å¤æ° GO11
ç®æ¬¡ ä»æ¥ã®æ¥ä»ã®åå¾2006å¹´1æ2æ¥ã®è¬Goã®å é¨å®è£ ãè¦ãã¦ã¿ãGoã®æ¨æºæ¥ä»ãã©ã¼ãããGoã®ç¾å¨æå»ã¯ time.Now() ã§åå¾ãããã¨ãã§ãããããã©ã¼ããããããç¾å¨æ¥æã¯ã©ã®ããã«åå¾ããã°ããã®ã ãããï¼ ä»æ¥ã®æ¥ä»ã®åå¾ package main import ( "fmt" "time" ) func main() { // ãã©ã¼ããããªãç¾å¨æå» fmt.Println(time.Now()) // ãã©ã¼ãããããç¾å¨æå» fmt.Println(time.Now().Format("2006å¹´01æ02æ¥")) } 2006å¹´1æ2æ¥ã®è¬ãããããã§ï¼ã¤ã®çåãæ®ããFormat()ã®å¼æ°ã¨ãã¦ä¸ãããã 2006å¹´01æ02æ¥ ã¯ã©ããã¦2006å¹´1æ2æ¥ãªã®ã ãããï¼ã2001å¹´2æ3æ¥ã§ããã¡ã ã1234å¹´5æ6æ¥ã§ããã¡ã ããã£ã¡ã 2006å¹´1æ
以ä¸ã®è¨äºãè¦ã¦æãã¤ãããã¨ãæ¯ãè¨ã¨ãã¦æ¸ãã¦ããã ã³ã¼ãå°ãªç®ã§ã´ã¡ã³ãã³ã³ï¼ã©ã£ã¡ã®ã»ã¯ã·ã§ã³ã§æ¸ãããæ©ãã ï¼ã Golangã®æ£è¦è¡¨ç¾ãã©ãããããããã®ããPythonã¨æ¯è¼ãã¦ã¿ã話 - Qiita 詳ãã解説ã¯ããã¯ãã¼ã¯ã«ããè¨äºãåç §ã®ãã¨ã æ£è¦è¡¨ç¾ regexp ããã±ã¼ã¸ã¯ï¼æ¦ãï¼é ã ããããæ£è¦è¡¨ç¾ï¼regular expressionï¼ã¯ï¼ããèªä½ãè¨èªã®ä¸ç¨®ã¨è¨ãã1ã ã¹ã¯ãªããè¨èªã®ããã«è¨èªä»æ§ã®ä¸é¨ã¨ãã¦çµã¿è¾¼ã¾ãã¦ããå ´åã¯å¥ã ãï¼ Go è¨èªã®ãããªã³ã³ãã¤ã«è¨èªã®å ´åï¼æ®éã¯ï¼è¨èªæ¬ä½ã§ã¯ãªãï¼ã©ã¤ãã©ãªããã¬ã¼ã ã¯ã¼ã¯ã®ä¸é¨ã¨ãã¦çµã¿è¾¼ã¾ããã Go è¨èªæ¨æºã®æ£è¦è¡¨ç¾ã¨ã³ã¸ã³ã§ãã regexp ããã±ã¼ã¸ã¯ï¼Perl ã Ruby ã¨ãã£ãè¨èªã«æ¯ã¹ã¦ï¼æ¦ãé ãã ããã¯æ¬å½ã§ããã regexp ããã±ã¼ã¸ã®è¨è¨æ¹éã«ã¤ãã¦ä»¥ä¸ã®
Go è¨èªã®æ¬¡ã®ãã¼ã¸ã§ã³ï¼v1.11ï¼ãã vgo (Versioned Go) ãå®è£ ããè¨ç»ãããããã§ï¼ vgo é¢é£ã®ããã¥ã¡ã³ããå ¬éããã¦ããã research!rsc: Go & Versioning research!rsc: Go += Package Versioning (Go & Versioning, Part 1) research!rsc: A Tour of Versioned Go (vgo) (Go & Versioning, Part 2) research!rsc: Semantic Import Versioning (Go & Versioning, Part 3) research!rsc: Minimal Version Selection (Go & Versioning, Part 4) research!rsc: Reproduci
(編注ï¼èª¤è¨³ãæå³ã®åããã¥ãã訳ãä¿®æ£ãã¾ããããªã¯ã¨ã¹ããããã¨ããããã¾ããã) æ¯æ¥ãPusherã¯æ°ååã®ã¡ãã»ã¼ã¸ããªã¢ã«ã¿ã¤ã ãã¤ã¾ãéãå ããå®å ã¾ã§100msæªæºã§éä¿¡ãã¦ãã¾ããã©ã®ããã«ãã¦ãããå¯è½ã«ãã¦ããã®ã§ãããããéè¦ã¨ãªãè¦å ã¯Goã®ä½ã¬ã¤ãã³ã·ã®ã¬ãã¼ã¸ã³ã¬ã¯ã¿ã§ãã ã¬ãã¼ã¸ã³ã¬ã¯ã¿ã¯ããã°ã©ã ãä¸æåæ¢ããããã®ã§ããããªã¢ã«ã¿ã¤ã ã·ã¹ãã ã®æ©ã¿ã®ç¨®ã§ãããã®ãããæ°ããã¡ãã»ã¼ã¸ãã¹ãè¨è¨ããéã«ã¯æ éã«è¨èªãé¸ã³ã¾ãããGo㯠ä½ã¬ã¤ãã³ã·ã強調ãã¦ãã ãã®ã®ãç§ãã¡ã¯æççã§ããããæ¬å½ã«Goã使ãã°å®ç¾ã§ããã®ãï¼ãããã§ãããªãã©ããã£ã¦ï¼ã ãã®ããã°è¨äºã§ã¯Goã®ã¬ãã¼ã¸ã³ã¬ã¯ã¿ããã©ã®ããã«æ©è½ãï¼ããªã³ãã¼ã«ã¢ã«ã´ãªãºã ï¼ããªãæ©è½ãï¼ãããªã«çãGCã«ããä¸æåæ¢æéã®å®ç¾ï¼ãããã¦ä½ãããããããæ©è½ããã®ãã©ããï¼GCã«ãã
Goroutineãã³ã¿ã¼ãããã¯éãåºããgoroutineéãæã¾ãããããæ¥å¤æ¦ãç¶ããã¨ã³ã¸ãã¢éã®ãã¨ã§ãããGoroutineãã³ã¿ã¼ã¯æ¬çªç°å¢ã§OOM Killerãçºåãããã³ã«å¼ã³åºãããéãåºãããã¹ã¦ã®goroutineãæã¾ããã¾ã§å®¶ã«ããããã¨ãåºæ¥ãªããããããããªããæ¸ããä½æ°ãªãã³ã¼ãã«ãã£ã¦ãä»æ¥ãã¾ãæ°ããgorutineéãéã«æ¾ãããã®ã§ãã£ãã Goroutineãªã¼ã¯ã¨ã®æ¦ã Goã使ç¨ãã¦ããç¨åº¦è¦æ¨¡ã®ããã°ã©ã ãæ¸ãã¨ãå¿ ãåé¡ã«ãªãã®ãgoroutineã®ãªã¼ã¯ã§ãããgoã§çã¾ããgoroutineããä½ããã®çç±ã§æ£å¸¸ã«çµäºããªãå ´åãããã¯ããªã¼ã¯ããã¦ããã¨è¦ãªãããããªã¼ã¯ããgoroutineã¯ããã»ã¹ãç¶ãéãæ°¸é ã«ãªã½ã¼ã¹ãææ¾ããªãããããªã¼ã¯ããgoroutineãèç©ããã«å¾ã£ã¦ãããã°ã©ã ã®ããã©ã¼ãã³ã¹ã¯ä½ä¸ãã¦ã
以ä¸ã®è¨äºãè¦ã¦æããèãæã£ãã Goã®arrayã¨sliceãç解ããã¨ãããã - Qiita ãªãã»ã©ï¼ ãããã風ã«èª¬æããã°ããã®ãã ã¨ããããã§ï¼ç§ã便ä¹ãã¦ã¿ãã ããã¾ã§ãç§ã®ããã®è¦ãæ¸ãã§ããã é åã¯å¸¸ã«ãå¤ãã§ãã ã¾ãã¯ãããªã³ã¼ããæ¸ãã¦ã¿ãã package main import "fmt" type Array4 [4]int8 func main() { ary := Array4{0, 1, 2, 3} fmt.Printf("ary = %p\n", &ary) for i := 0; i < len(ary); i++ { fmt.Printf("%p: %v\n", &ary[i], ary[i]) } }
åãã« Go 1.7ããªãªã¼ã¹ããããç®çã®ä¸ã¤ã¯ãSSA-IRãå°å ¥ããããã¨ã ãããGo1.7ã§SSAãå ¥ããã ãã©ãSSAã£ã¦ä½ï¼ã¨å± é å±ã§èããããã¨ãæ¬ç¨¿ã®çºç«¯ã ã£ããç§ã®ç¥èã ãã§ã¯å æ¬çãªèª¬æã«ãªããªãã£ãã®ã§ããããã調ã¹ã¤ã¤ãããã¾ã¨ããã 以ä¸ãä¸è¬çãªè©±ã§ã¯ãªãããªãã¹ãGoã«çµã£ã¦è©±ãé²ãã¦ããï¼ã³ã³ãã¤ã©ã®ã³ã¼ãã¯ã¯ cmd/compile/internal/gc ãããã«ããï¼ãããä¸è¬çãªè©±ã¯ãåèæç®çã示ããã®ã§ãã¡ããåèã«ãã¦ã»ããããããã調ã¹ã¦ãGoã«è¿½å ãããSSAã«ã¤ãã¦ç¥ãã¹ããã¨ã¯ãSSAãä½ãï¼ããããSSAå°å ¥ããGoãã©ããªã£ãããã§ããã¨æã£ãã SSAã¨ã¯ä½ã SSA ã¨ã¯ Static Single Assignmentã®ç¥ã ãä¸ã¤ã®å¤æ°ã¸ã®ä»£å ¥ã¯ä¸åº¦ããè¡ããã¦ãªãäºã確ç´ã§ããå½¢å¼ã®ã³ã¼ãã ããã®å½¢å¼ã®ã³ã¼ãã¯ãæé©åãè¡ã
以ä¸ã®ãã¤ã¼ãã«ãããéããä¸è¦ golang 㯠struct ãå®ç¾©ããªã㨠JSON ãæ±ããªãããã«è¦ãã¾ããä»ã«ãä¼¼ããããªãã¤ã¼ãããã©ãã©ã¨è¦ããã¾ãããããããã¯å ¨é¨èª¤è§£ã§ããããã§ãã®è¨äºã§ã¯ãgolang ã§ãããµã (structãå®ç¾©ãã) ã« JSON ãæ±ãæ¹æ³ãç´¹ä»ãã¾ãã golangãrubyã®ããã«ãããµãã«JSONã¯æ±ããªã? https://t.co/olsryDHc5G â bamchoh (@bamchoh) 2016å¹´6æ24æ¥ ãã®è¨äºã§ã¯å ¥åã® json.Unmarshal() ãåãæ±ãã¾ãããåºåã® json.Marshal() ã«ãå¿ç¨ã§ãã¾ãã TL;DR json.Unmarshal() ã«ã¯ *interface{} ã渡ãã¾ã interface{} 㯠dproxy ã使ãã¨ãå¤ã®ã¢ã¯ã»ã¹ã§æ¥½ãã§ãã¾ã json.Unmar
« Re: Vimã§URLããã¡ã¤ã³ã ãã«ç½®æããã³ãã³ããæ£è¦è¡¨ç¾ã§ãã£ãããæ¬å½ã«æ£è¦è¡¨ç¾ã£ã¦æå³ä¸æãªãã©ã«ã ã¨æã£ãã | Main | golang ã®ãªãã¡ã¯ã¿ãªã³ã°ã«ã¯ gofmt ã§ã¯ãªããgorename ã使ããã » golang ã«ã¯ go build ã¨ãããã«ãæ©è½ããããCè¨èªã¨ golang ãã¾ãã cgo ã¨ããCè¨èªæ¡å¼µãåãã³ãã³ãã§ãã«ãåºæ¥ã¾ãã ãã®éãã½ã¼ã¹ã³ã¼ãã®ã³ã¡ã³ãã« CFLAGS ã LDFLAGS ãèªãæå®ããäºãåºæ¥ãã®ã§ package gtk // #include "gtk.go.h" // #cgo pkg-config: gtk+-2.0 import "C" import ( "fmt" "log" "reflect" "runtime" "strings" "unsafe" "github.com/mattn/g
ttyrec ã§é²ç»ãããã¼ã¿ã使ã£ã¦ã¿ã¼ããã«ä¸ã§åçãã¤ã¤ããã®ã¹ã¯ãªã¼ã³ãã£ããã£ã使ã£ã¦ã¢ãã¡ã¼ã·ã§ã³GIFãçæãããã¼ã«ãGoã§ä½ã£ã¦ã¿ãã https://github.com/sugyan/ttygif Releases Mac, Linux Desktopã§åä½ãåçé度ã¯ãªãã·ã§ã³ã§å¤æ´å¯è½ã èæ¯ percolã使ã£ã¦ã¿ã¼ããã«æä½ãæ©ãã便å©ã«ã - ãããã¼ãã¡ã¢ ã®ãããªè¨äºãæ¸ãããããéã«ãã¿ã¼ããã«æä½ãé²ç»ãã¦GIFã¢ãã¡ã«ãããéè¦ãããã ãããã£ãç¨éã«ä½¿ããæ±ç¨ã®ãã¹ã¯ãããé²ç»ãã¼ã«ã¨ãã¦ã¯LICEcapãGifzoãªã©ãããã Cockos Incorporated | LICEcap http://gifzo.net/ ãããã¯Windows, OSXãããã対象ã§ãLinuxã®å ´åã¯ã¾ãä»ã®ãã¼ã«ãããããã(ããç¥ããªã)ã æ±ç¨çãªã
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}