ãŽãŒãã¡ãŒ -ãŽãŒãã¹ã³ãã
å°ãåã«ããµãŒãããŒãã£ã®ãããžã§ã¯ãã§Goã䜿çšããå¯èœæ§ã®ç 究ãéå§ãããã®ããã°ã©ãã³ã°èšèªã®çŸããã«åçŽã«é©ããŸããã
ãã®éçºè ã¯ãéåžžãåçåä»ããè¡ãã€ã³ã¿ãŒããªã¿åèšèªã«åºæã®äœ¿ãããããšãéçåä»ããåããã³ã³ãã€ã«èšèªã«å žåçãªã»ãã¥ãªãã£ïŒåå®å šæ§ãã¡ã¢ãªäœ¿çšéå®å šæ§ïŒãçµã¿åãããããã©ãŒãã³ã¹ã®ãã©ã³ã¹ããšãããšãã§ãããšæããŸãã
ãã®èšèªã«ã¯ãææ°ã®ã·ã¹ãã ã®éçºã«æé©ãª2ã€ã®æ©èœããããŸãã èšäºã®ãStrengthsããšããã»ã¯ã·ã§ã³ã§ããããã«ã€ããŠè©³ãã説æããŸãã
ãããã®1ã€ã¯ã ãã¡ãŒã¹ãã¯ã©ã¹ã®åæå®è¡æ§ãµããŒãã§ãïŒãŽã«ãŒãã³ãšãã£ãã«ã䜿çšããŸãã以äžã§èª¬æããŸãïŒã å®çŸ©ã«ããã競äºåã«ãããããã»ããµã®ã³ã¢ã1ã€ãããªããŠããCPUã®å©çšå¯èœãªãã¹ãŠã®é»åãããå¹ççã«äœ¿çšã§ããŸãã Goã§ã¯ãåããã·ã³äžã§æ°åäžã®ãŽã«ãŒãã³ïŒè»œéã¹ã¬ããïŒãåæã«å®è¡ã§ããŸãã ãã£ãã«ãšãŽã«ãã³ã¯ããµãã©ã€ã€-ã³ã³ã·ã¥ãŒãïŒãããã¥ãŒãµ-ã³ã³ã·ã¥ãŒãã¡ãã»ãŒãžã³ã°ãã©ãã€ã ïŒã®æŠå¿µã®ãã¬ãŒã ã¯ãŒã¯å ã§ã¡ãã»ãŒãžã®éä¿¡ã«é¢é£ããã¡ã«ããºã ãæœè±¡åãããããåæ£ã·ã¹ãã ã®æ§ç¯ã«ãããŠéåžžã«éèŠã§ãã
Goã«æ»ã£ãŠãç§ã¯ã€ã³ã¿ãŒãã§ãŒã¹ãæ¬åœã«å¥œãã§ãã ã€ã³ã¿ãŒãã§ã€ã¹ã䜿çšãããšãççµåãŸãã¯å®å šã«ç¡é¢ä¿ãªã³ã³ããŒãã³ãã«åºã¥ããŠã·ã¹ãã ãäœæã§ããŸãã ãããã£ãŠãã³ãŒãã¯ã€ã³ã¿ãŒãã§ã€ã¹ã®çš®é¡ã«äŸåããããšãã§ãããã®ã€ã³ã¿ãŒãã§ã€ã¹ã誰ãã©ã®ããã«å®è£ ããããå®éã«å¿é ããå¿ èŠã¯ãããŸããã ã³ã³ãããŒã©ãŒã¯ããã®ã³ãŒãã«ããã¹ãŠã®æ©èœãå®è£ ããã€ã³ã¿ãŒãã§ãŒã¹ã«å¯Ÿå¿ããäŸåé¢ä¿ãæäŸããŸãã ããã«ããããŠããããã¹ãçšã®åªããã¢ãŒããã¯ãã£ãäœæã§ããŸãïŒäŸåæ§æ³šå ¥ã䜿çšïŒã ã³ã³ãããŒã©ãŒã¯ãå¿ èŠãªã€ã³ã¿ãŒãã§ã€ã¹ã³ãŒãã®å®è£ ãæ¿å ¥ïŒæš¡å£ïŒã§ããŸããããã«ããããã®åäœã®æ£ç¢ºæ§ããã¹ãã§ããŸãã
ããããã¹ãŠã®æ©èœãèãããšãç¹ã«ã¯ã©ãŠãïŒWebãµãŒããŒãCDNããã£ãã·ã¥ãªã©ïŒããã³åæ£ã·ã¹ãã ããã€ã¯ããµãŒãã¹ãªã©ã®éçºã«é¢ããŠã¯ãGoã¯çŽ æŽãããèšèªã§ãããšèšãããšæããŸãã次ã®ãããžã§ã¯ãã§äœ¿çšããèšèªãéžæããããšãèãããšãGoãçå£ã«æ€èšããããšããå§ãããŸãã
ãã®èšäºã§ã¯ãèšèªã®æ¬¡ã®åŽé¢ã«ã€ããŠã話ãããäºå®ã§ãã
- ã¯ããã«
- ãªãè¡ãã®ïŒ
- 察象è ã
- å²Strengthã®åŒ·ã¿ã
- Goã®åŒ±ç¹ã
- Go 2ã«åãã£ãŠããŸãã
- å²Philã®å²åŠã
- ã©ãããå§ããŸããã
- Goã䜿çšããã®ã¯èª°ã§ããã
ã¯ããã«
Goã¯ãRobert GriesemerãRob Pikeãããã³Ken Thompsonã«ãã£ãŠGoogleã§äœæããããªãŒãã³ãœãŒã¹èšèªã§ãã ãã®å Žåã®ãªãŒãã³ãœãŒã¹ã³ãŒãã¯ã誰ããèšèªã®éçºã«åå ããæ°ããæ©èœã®éçºããã°ã®ä¿®æ£ãªã©ãææ¡ã§ããããšãæå³ããŸããèšèªã³ãŒãã¯GitHubã§å ¥æã§ããŸã ã éçºãžã®åå ã«é¢ããããã¥ã¡ã³ãã¯ã ããã«ãããŸã ã
ãªãè¡ã
èè ãã¯ãæ°ããèšèªãäœæããäž»ãªçç±ã¯ããœãããŠã§ã¢éçºã«é¢é£ããŠGoogleã§çºçããåé¡ã解決ããããšããããšã ãšèšããŸãã ãŸããGoã¯C ++ã®ä»£æ¿ãšããŠéçºãããããšã«ãèšåããŠããŸãã
Goã®ããã·ã§ã³ã«ã€ããŠRob Pikeãèšã£ãŠããããšã¯æ¬¡ã®ãšããã§ãã
ãGoã®ç®æšã¯ãããã°ã©ãã³ã°èšèªã®èšèšãç 究ããããšã§ã¯ãããŸããã éçºè ãšååã®äœæ¥ç°å¢ãæ¹åããããšã«ãããŸãã Goã¯ãããã°ã©ãã³ã°èšèªã®ç 究ããããœãããŠã§ã¢éçºã«éç¹ã眮ããŠããŸãã ãŸãã¯ãèšãæãããšãGoã¯äž»ã«éçºç®æšã«åœ¹ç«ã€ããã«èšèšãããŠããŸãã
Goã®äœæãä¿ããGoogleã®åé¡ ïŒ https://talks.golang.org/2012/splash.articleããååŸïŒïŒ
- æ倧1æéç¶ãé ãã¢ã»ã³ããªã
- å¶åŸ¡äžèœãªäŸåé¢ä¿ã
- èšèªã®ç°ãªããµãã»ããã®ããã°ã©ããŒã«ãã䜿çšã
- ã³ãŒãã®èªã¿åãã®é£ããïŒä»ã®äººãæžããããã°ã©ã ãç解ããéã®åé¡ãããã¥ã¡ã³ãã®éãšè³ªãäžååãªã©ïŒã
- åªåã®éè€
- æŽæ°ã®ã³ã¹ã
- ã¹ãã¥ãŒããŒãžã§ã³ïŒããŒãžã§ã³ã¹ãã¥ãŒïŒã
- èªååããŒã«ã®äœæã®é£ããã
- èšèªéã¢ã»ã³ããªã
Goãæåããã«ã¯ããããã®åé¡ã解決ããå¿ èŠããããŸã ïŒ https://talks.golang.org/2012/splash.articleããååŸïŒã
- Goã¯ã倧èŠæš¡ãªéçºããŒã ãå€ãã®äŸåé¢ä¿ãæã€ããã°ã©ã ã®ããã«å€§èŠæš¡ã«åäœããã¯ãã§ãã
- Goã¯ãæ¯èŒçCã«äŒŒã䜿ãæ £ãããã®ã§ãªããã°ãªããŸããã Googleã§ã¯ãããã°ã©ããŒãæ°ããèšèªã䜿çšããŠçç£æ§ã®é«ãäœæ¥ãè¿ éã«éå§ããå¿ èŠããããããããŸãã«ãæ¥é²çã§ãã£ãŠã¯ãªããŸããã
- Goã¯ã¢ãã³ã§ãªããã°ãªããŸããã 圌ã¯ãããã°ã©ãããã«ãã³ã¢ãã·ã³ãå¹ççã«äœ¿çšã§ããããã«ã競äºåãªã©ã®æ©èœãå¿ èŠãšããŠããŸãã ãããã¯ãŒã¯ãšWebãµãŒããŒãšããŠåäœããããã®çµã¿èŸŒã¿ã©ã€ãã©ãªãå¿ èŠã§ãã
察象èªè
Goã¯ã·ã¹ãã ãæ§ç¯ããããã®èšèªã§ãã ã¯ã©ãŠããœãªã¥ãŒã·ã§ã³ïŒWebãµãŒããŒããã£ãã·ã¥ïŒããã€ã¯ããµãŒãã¹ãããã³åæ£ã·ã¹ãã ïŒç«¶äºåãµããŒãã®ããïŒã«æé©ã§ãã
匷ã¿
éçåä»ã
Goã¯éçãªåä»ãèšèªã§ãã ã€ãŸãããã§ã«ã³ã³ãã€ã«æ®µéã§ããã¹ãŠã®å€æ°ãé¢æ°ã®åŒæ°ãããã³æ»ãå€ã®åã宣èšããå¿ èŠããããŸãã ãã®ã¢ãããŒãã¯äžäŸ¿ã«æãããããããŸããããããã¯ã³ã³ãã€ã«æã«å€ãã®ãšã©ãŒãèŠã€ãããããå®éã«ã¯å©ç¹ã§ãã ãã®èŠçŽ ã®éèŠæ§ã¯ãã³ãã³ãã®ãµã€ãºãšãšãã«å€§ãããªããŸããå宣èšã«ãããã©ã€ãã©ãªãšé¢æ°ãèªã¿ããããªããç解ãããããªãããã§ãã
ã³ã³ãã€ã«é床
Goã§èšè¿°ãããã³ãŒãã¯éåžžã«é«éã«ã³ã³ãã€ã«ããããããã³ã³ãã€ã«ãå®äºãããŸã§åŸ
ã€å¿
èŠã¯ãããŸãã:)å®éã go run
ã³ãã³ãã¯ããã°ã©ã ãéåžžã«é«éã«èµ·åãããããæåã¯ã€ã³ã¿ããªã¿èšèªã§äœæ¥ããŠãããã®ããã«ã³ã³ãã€ã«ããŸã£ãããªãããã«ããæããŸãã
å®è¡é床
Goã®ã³ãŒãã¯ã䜿çšãããOSïŒLinux / Windows / MacïŒãšãã³ã³ãã€ã«ãå®è¡ããããã·ã³ã®CPUã®ã¢ãŒããã¯ãã£ïŒx86ãx86â64ãARMãªã©ïŒã«äŸåãããã·ã³ã³ãŒãã«çŽæ¥ã³ã³ãã€ã«ãããŸãã ãããã£ãŠãGoããã°ã©ã ã¯éåžžã«é«éã«åäœããŸãã
移æ€æ§
ããã°ã©ã ã¯ãã·ã³ã³ãŒãã«çŽæ¥ã³ã³ãã€ã«ãããããããã€ããªãã¡ã€ã«ã¯åããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ãšã¢ãŒããã¯ãã£å ã§ç§»æ€å¯èœã§ãã
ãã®å¯èœæ§ã¯ãGoãã€ããªãéçã«ãªã³ã¯ãããŠãããšããäºå®ãã€ãŸããããã°ã©ã ã«å¿
èŠãªãã¹ãŠã®å
±æã©ã€ãã©ãªãã³ã³ãã€ã«æ®µéã§ãã€ããªãã¡ã€ã«ã«å«ãŸããŠããããã«çºçããŸãã åçã«ãããã°ã©ã ã®å®è¡äžã¯ãªã³ã¯ããŸããã
ããã¯ãããŒã¿ã»ã³ã¿ãŒã®å€æ°ã®ãã·ã³ã«ããã°ã©ã ãå±éãããšãã«äŸ¿å©ã§ãã ãã€ããªã¯ãïŒããšãã°scp
ã䜿çšããŠïŒä»»æã®æ°ã®ãã·ã³ã«åçŽã«ã³ããŒã§ããŸãããã ãããã¡ãããOSãšã¿ãŒã²ããã·ã¹ãã ã®ã¢ãŒããã¯ãã£çšã«ã³ã³ãã€ã«ãããŠããå¿
èŠããããŸãã Linuxã®ã€ã³ã¹ããŒã«ãããããŒãžã§ã³ã«ã€ããŠå¿é
ããããäŸåé¢ä¿ã管çãããããå¿
èŠã¯ãããŸããã ããã°ã©ã ã¯ãã èµ·åããŠåäœããŸã:)
競äºå
Goã¯éåžžã«ç«¶äºåã®ãããµããŒããæäŸããŸããããã¯ããã®ããã°ã©ãã³ã°èšèªã®æãéèŠãªå©ç¹ã®1ã€ã§ãã Goã®ç«¶äºåã¡ã«ããºã ã¯ãTony Hoareã®ãCommunicating Sequential Processesãã«åºã¥ããŠããŸãã
Goã©ã³ã¿ã€ã ã䜿çšãããšãæ°åäžã®ç«¶åãŽã«ãŒãã³ã1å°ã®ãã·ã³ã§å®è¡ã§ããŸãã Gorutinã¯è»œéã®å®è¡ã¹ã¬ããã§ãã Goã¯ãOSã¹ã¬ããã§ãŽã«ãŒãã³ãå€éåã§ããŸãã ã€ãŸããããã€ãã®ãŽã«ãŒãã³ã¯ããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®åãã¹ã¬ããã§ç«¶åã§ããŸãã Goã©ã³ã¿ã€ã ã¯ãgoroutineã®å®è¡ãå¶åŸ¡ããã¿ã¹ã¯ãæã€ç¹å¥ãªã¹ã±ãžã¥ãŒã©ãŒãæäŸããŸãã
ãã®ã¢ãããŒãã«ã¯2ã€ã®å©ç¹ããããŸãã
åæåæã«ãgorutinã¯ã¹ã¿ãã¯äžã§4 KBã®ã¿ãå æããŸãã ããã¯ãããšãã°ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®ã¹ã¬ããã«éåžžå²ãåœãŠããã1ã¡ã¬ãã€ããšæ¯èŒãããšããããããã§ãã ãã®æ°ã¯ã1å°ã®ãã·ã³ã§æ°åäžã®ç°ãªããŽã«ãŒãã³ã競äºçã«å®è¡ããå¿ èŠãããå Žåã«éèŠã«ãªããŸãã OSã¹ããªãŒã ããããã®ç®çã«äœ¿çšãããå ŽåãRAMã¯éåžžã«æ©ãçµäºããå¯èœæ§ããããŸãã
- Goã¯ããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®ã¹ã¬ããã䜿çšããJavaã®ãããªä»ã®èšèªãšåãããã«é²ãããšãã§ããŸãã ãã ãããã®å ŽåãOSã¹ã¬ããéã§ã³ã³ããã¹ããåãæ¿ããã³ã¹ãã¯ãç°ãªããŽã«ãŒãã³éã§ã³ã³ããã¹ããåãæ¿ããã³ã¹ãã«æ¯ã¹ãŠã¯ããã«é«ããªããŸãã
ãã®èšäºã§ã競äºåãã«ã€ããŠç¹°ãè¿ãèšåããŠããã®ã§ãRob Pikeã競äºãšäžŠè¡æ§ã¯2ã€ã®ç°ãªããã®ã§ãããšèšã£ãŠãããããªãèŠãããšããå§ãããŸãã ããã°ã©ãã³ã°ã«ãããŠã競åæ§ãšã¯ã䞊åæ§ãç¬ç«ããèšç®ããã³/ãŸãã¯äŸåããèšç®ã®åæå®è¡ã§ããå Žåã«ãç¬ç«ããŠå®è¡ããäžé£ã®ããã»ã¹ãæå³ãããšç解ãããŠããŸãã 1ã€ã®ã³ã¢ã§ã¯ãåäœæéããã1ã€ã®æäœããå®è¡ã§ããªããããåæå®è¡æ§ã¯å©çšã§ããŸããã ãã ãããã®å Žåã§ã競äºã¯å¯èœã§ãã ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã¹ã±ãžã¥ãŒã©ã¯ãããŸããŸãªã¿ã€ã ã¹ã©ã€ã¹ã§ããŸããŸãªããã»ã¹ïŒå®éã«ã¯ãåããã»ã¹ã«å°ãªããšãã¡ã€ã³ã¹ã¬ããããããããã¹ã¬ããïŒãéå§ããŸãã ãããã£ãŠãåäœæéå ã«ãããã»ããµã¯1ã€ã®ã¹ã¬ããã®ã¿ã«ãã£ãŠå æãããŸãã æäœãé«éã§ãããããè€æ°ã®ããã°ã©ã ãåæã«å®è¡ãããŠããããã§ãã ããããå®éã«ã¯ããã¹ãŠã1ã€ã«ãªããŸãã
競äºåã«ãããäžåºŠã«è€æ°ã®ããšãåŠçããåæå®è¡æ§-åæã«ããã€ãã®ããšãè¡ãããšãã§ããŸãã
ã€ã³ã¿ãŒãã§ãŒã¹
ã€ã³ã¿ãŒãã§ã€ã¹ã䜿çšãããšãççµåã·ã¹ãã ãäœæã§ããŸãã Goã§ã¯ãã€ã³ã¿ãŒãã§ã€ã¹ã¿ã€ããäžé£ã®é¢æ°ãšããŠå®çŸ©ã§ããŸãã ãããŠããã ãã§ãã ãããã®é¢æ°ãå®è£ ããåã¯ãæé»çã«ã€ã³ã¿ãŒãã§ãŒã¹ãå®è£ ããŸããã€ãŸããåãç¹å®ã®ã€ã³ã¿ãŒãã§ãŒã¹ãå®è£ ããããšã瀺ãå¿ èŠã¯ãããŸããã ã³ã³ãã€ã©ã¯ã³ã³ãã€ã«æã«ãããè¡ããŸãã
ãããã£ãŠãã³ãŒãã¯ã€ã³ã¿ãŒãã§ã€ã¹ã®çš®é¡ã«äŸåããããšãã§ãããã®ã€ã³ã¿ãŒãã§ã€ã¹ã誰ãã©ã®ããã«å®è£ ããããå®éã«å¿é ããå¿ èŠã¯ãããŸããã ã³ã³ãããŒã©ãŒã¯ããã®ã³ãŒãã«ããã¹ãŠã®æ©èœãå®è£ ããã€ã³ã¿ãŒãã§ãŒã¹ã«å¯Ÿå¿ããäŸåé¢ä¿ãæäŸããŸãã ããã«ããããŠããããã¹ãçšã®åªããã¢ãŒããã¯ãã£ãäœæã§ããŸãïŒäŸåæ§æ³šå ¥ã䜿çšïŒã ã³ã³ãããŒã©ãŒã¯ãã³ãŒãã§å¿ èŠãªã€ã³ã¿ãŒãã§ã€ã¹ã®å®è£ ãæ¿å ¥ïŒæš¡å£ïŒã§ããŸããããã«ãããæäœã®æ£ç¢ºæ§ããã¹ãã§ããŸãã
ãã€ã¯ããµãŒãã¹ã¢ãŒããã¯ãã£ã®é¢ã§ãå©ç¹ããããŸãã ã¢ããªã±ãŒã·ã§ã³ã1ã€ã®ãµãŒããŒïŒãããžã§ã¯ãã®æåïŒã«ããå Žåããã®æ©èœãããŸããŸãªãã€ã¯ããµãŒãã¹ã«ãã£ãŠå®è¡ãããããã«èšèšããŸããåãã€ã¯ããµãŒãã¹ã¯ç¬èªã®ã€ã³ã¿ãŒãã§ã€ã¹ãå®è£ ããŸãã ãããã£ãŠãä»ã®ãµãŒãã¹/ã³ã³ãããŒã©ã¯ãå éšçã«å®è£ ãããæ¹æ³ãå¿é ããããšãªããã€ã³ã¿ãŒãã§ã€ã¹ã¡ãœãããåŒã³åºããŸãã
ã¬ããŒãžã³ã¬ã¯ã·ã§ã³
Cãšã¯ç°ãªããGoã¯åçã«å²ãåœãŠãããã¡ã¢ãªã解æŸããå¿ èŠããªãããã³ã°ãªã³ã°ãã€ã³ã¿ãŒãå¿é ããå¿ èŠã¯ãããŸããã ã¬ããŒãžã³ã¬ã¯ã¿ãŒãããããåŠçããŸãã
äŸå€ãªã
èªåã§ãšã©ãŒãåŠçããŠãã ããã Goã¯ãä»ã®å€ãã®èšèªãšã¯ç°ãªããäŸå€ãåŠçããããã®æšæºçãªã¡ã«ããºã ããªãããšãéåžžã«å¬ããæããŸãã ããã®éçºè
ã¯ãããã¡ã€ã«ãéãããšãã§ããŸããã§ããããªã©ã®ãšã©ãŒãèªåã§åŠçããå¿
èŠããããŸãtry catch
ã³ãŒããã©ããããæ¹æ³ã¯ãããŸããã ã€ãŸããããã°ã©ãã¯ãããã®ãšã©ãŒãæ£ããåŠçããæ¹æ³ã«ã€ããŠèããããšããå§ãããŸãã
çŽ æŽãããããŒã«ããã¯ã¹
Goã®æã楜ããåŽé¢ã®1ã€ã¯ããã®ããŒã«ã§ãã
Gofmtã¯ãã³ãŒããšã€ã³ãã³ããèªåçã«ãã©ãŒãããããŸãã ããã«ãããGoã®ã³ãŒãã¯ããã®èšèªã®éçºè ã§äŸå€ãªãäœæããããšãªãããã¹ãŠã®ãŠãŒã¶ãŒã«å¯ŸããŠåãããã«èŠããããã«ãªããã³ãŒãã®å¯èªæ§ãå€§å¹ ã«åäžããŸãã
Go runã¯ãã³ãŒããã³ã³ãã€ã«ããŠå®è¡ããŸãã ã¯ããGoããã°ã©ã ã¯ã³ã³ãã€ã«ããå¿ èŠããããŸãããéåžžã«é«éã§ãããããã€ã³ã¿ããªã¿èšèªã§äœæ¥ããŠããããã«æããŸãã
Go getã¯ã©ã€ãã©ãªãGitHubããããŠã³ããŒãããŠGoPathã«ã³ããŒãããã®åŸãããžã§ã¯ãã«ã€ã³ããŒãã§ããŸãã
- Godoc㯠ãã³ã¡ã³ããå«ãGoãœãŒã¹ã³ãŒãã解æã ããã¬ãŒã³ããã¹ããŸãã¯HTML圢åŒã§ããã¥ã¡ã³ããåºåããŸãã godoc Webã€ã³ã¿ãŒãã§ãŒã¹ã䜿çšãããšãããã¥ã¡ã³ããšã³ãŒããäžç·ã«è¡šç€ºã§ããŸããããšãã°ã1åã®ã¯ãªãã¯ã§é¢æ°ã®ããã¥ã¡ã³ããããã®å®è£ ã«ç§»åã§ããŸãã
ãããã®ããŒã«ããã³ãã®ä»ã®ããŒã«ã¯ã ããã§èŠã€ããããšãã§ããŸã ã
åªããçµã¿èŸŒã¿ã©ã€ãã©ãª
Goã«ã¯ãçŸä»£ã®éçºè ã®äœæ¥ã楜ã«ããããã«èšèšããã次ã®çµã¿èŸŒã¿ã©ã€ãã©ãªããããŸãã
- net / httpã¯ãHTTPã¯ã©ã€ã¢ã³ããšãµãŒããŒã®å®è£ ãæäŸããŸãã
- database / sql㯠ãSQLããŒã¿ããŒã¹ãšå¯Ÿè©±ããããã«èšèšãããŠããŸãã
- ãšã³ã³ãŒãã£ã³ã°/ jsonã¯ããã¡ãŒã¹ãã¯ã©ã¹ã®JSONãµããŒããæäŸããŸãã
- html / templates -HTMLãã³ãã¬ãŒããæäœããããã®ã©ã€ãã©ãªã
- io / ioutil-è£å©å ¥åºåé¢æ°ã
ããããçš®é¡ã®ãŠãŒã¹ã±ãŒã¹ã®ã©ã€ãã©ãªãšãã¬ãŒã ã¯ãŒã¯ã¯ã ããã«ãããŸã ã
匱ç¹
ãžã§ããªãã¯å»è¬åã®äžè¶³
ãžã§ããªãã¯ã䜿çšãããšãåŸã§æå®ãããåã䜿çšããŠã¢ã«ãŽãªãºã ãäœæã§ããŸãã æŽæ°ããœãŒãããé¢æ°ãäœæããå¿ èŠããããšããŸãã 次ã«ãæååã®ãªã¹ãããœãŒãããé¢æ°ãå¿ èŠã§ããã ãã®æç¹ã§ããããã®é¢æ°ã®ã³ãŒãã¯ã»ãŒåãã§ããããšãç解ããŠããŸãããæŽæ°ã®ãªã¹ããåŒæ°ãšããŠåãåããæååã®ãªã¹ããåãåãããšãæåŠãããããæåã®é¢æ°ã¯äœ¿çšã§ããŸããã äœãããå¿ èŠã¯ãããŸãããã³ãŒããè€è£œããå¿ èŠããããŸãã Goããžã§ããªãã¯ã§ããå ŽåãTåã®èŠçŽ ã®ãªã¹ãããœãŒãããé¢æ°ãäœæããæŽæ°ãæååãããã³é åºä»ãé¢æ°ãååšããä»ã®åã«å¯ŸããŠåãé¢æ°ãåŒã³åºãããšãã§ããŸãã ã€ãŸããã³ã³ãã€ã©ã¯ãã®åã®å€ãæ¯èŒã§ããå¿ èŠããããŸãã
Goã«ã¯ã空ã®ã€ã³ã¿ãŒãã§ã€ã¹ïŒã€ã³ã¿ãŒãã§ã€ã¹{}ïŒã䜿çšããŠãžã§ããªãã¯ã«äŒŒãæ©èœãå®è¡ããæ©èœããããŸãã ãããããã®ãœãªã¥ãŒã·ã§ã³ã«ã¯æ¬ é¥ããªãããã§ã¯ãããŸããã
ãžã§ããªãã¯ã¯éåžžã«ç©è°ãéžããããã¯ã§ãã ä»ã®äººããžã§ããªãã¯ãã³ã³ãã€ã«æéãšããã°ã©ã å®è¡æéã®éã®åŠ¥åãè¡šãã®ã§ãèšèªã«ãžã§ããªãã¯ãå«ããããªããšãã«åœŒãã®ããã«ç¥ãããã°ã©ããŒãããŸãã
Goã®äœæè ã¯ãGoã§ã®äžè¬çãªã¡ã«ããºã ã®å®è£ ã«é¢ãã察話ãåãå ¥ããŠãããšèšããŸãã ãããããžã§ããªãã¯ã ãã§ã¯ãããŸããã ãããã¯ãä»ã®ã³ã³ããŒãã³ããšé©åã«çžäºäœçšããå Žåã«ã®ã¿ãèšèªã§å®è£ ã§ããŸãã Go 2ãåŸ ã£ãŠããã®åé¡ã®è§£æ±ºçããããã©ããã確èªããŸãããã
äŸåé¢ä¿ç®¡çã®æ¬ åŠ
ãGo 1 promiseãã䜿çšãããšãGo 1ãšGo 1.9ã®äž¡æ¹ã§Goèšèªãšãã®ã©ã€ãã©ãªãAPIãå€æŽããªãããšã確èªã§ããŸããã³ãŒãã¯Go 1.5ãšGo 1.9ã®äž¡æ¹ã§ã³ã³ãã€ã«ããå¿
èŠããããŸãã ã»ãšãã©ã®ãµãŒãããŒãã£ã©ã€ãã©ãªã¯ãã®çŽæã«åŸããŸãã go get github.com/vendor/library
ã䜿çšããŠgo get
ã䜿çšããŠGitHubãããµãŒãããŒãã£ã®ã©ã€ãã©ãªãããŠã³ããŒããããããmasterãã©ã³ãã®ææ°ã³ãŒãã®APIã«å€æŽããªãããšã®ã¿ãæåŸ
ã§ããŸãã ãŸããªãµãŒãããŒãã£ã®ãããžã§ã¯ãã®å Žåãã»ãšãã©ã®ã©ã€ãã©ãªã¯åœŒãã®èšèãä¿æããŠãããããããã¯ããã»ã©æªãã¯ãããŸããããæ¬çªã§ã¯ãªãã·ã§ã³ã¯æè¯ã§ã¯ãããŸããã
çæ³çã«ã¯ãäŸåé¢ä¿ãããŒãžã§ã³ç®¡çããäœããã®æ¹æ³ãå¿ èŠã§ãããã®æ¹æ³ã§ã¯ãäŸåé¢ä¿ãã¡ã€ã«ã§ãµãŒãããŒãã£ã©ã€ãã©ãªã®ããŒãžã§ã³çªå·ãæå®ã§ããŸãã ãã®å Žåã䜿çšããŠããããŒãžã§ã³ã«ã¯åœ±é¿ããªããããAPIã®å€æŽã«ã€ããŠå¿é ããå¿ èŠã¯ãããŸããã åŸã§éãã調ã¹ãæ°ããããŒãžã§ã³ãžã®ç§»è¡ã決å®ããå¿ èŠã«å¿ããŠã³ãŒãã«é©åãªå€æŽãå ããäŸåãã¡ã€ã«ã§æ°ããããŒãžã§ã³çªå·ã瀺ãããšãã§ããŸãã
Goã¯depãšåŒã°ããå ¬åŒã®å®éšãè¡ã£ãŠããŸãããããããã®åé¡ã解決ããããšãé¡ã£ãŠããŸãã ããããããã¯Go 2ã§ãã§ã«çºçããŠããã§ããã:)
Go 2ãžã®ç§»è¡
Goã®äŸã§èŠãèšèªãäœæããããã®ãªãŒãã³ãœãŒã¹ã®ã¢ãããŒããæ¬åœã«å¥œãã§ãã Go 2ã§å®è£ ããå¿ èŠãããæ©èœãå¿ èŠãªå Žåã¯ã次ã®å 容ã®ããã¥ã¡ã³ããäœæããŸãã
- ãŠãŒã¹ã±ãŒã¹ã®èª¬æã
- ãã®èšèªã§çŸåšå©çšå¯èœãªããŒã«ã䜿çšããŠåé¡ã解決ããããšãäžå¯èœã§ããããšã®èª¬æã
- åé¡ã®é倧床ã®ç¹åŸŽä»ãïŒåªå é äœãã€ããã»ã©éèŠã§ã¯ãªããã®ããããŸãïŒã
- åé¡ã®è§£æ±ºçïŒãªãã·ã§ã³ïŒã
èè ã¯ææ¡ãæ€èšããè©æ±ºãäžããŸãã ãããã®åé¡ã«é¢ããè°è«ã¯ãã¡ãŒãªã³ã°ãªã¹ããšåé¡è¿œè·¡ã·ã¹ãã ã§å ¬éãããŠããŸãã
ç§ã®æèŠã§ã¯ãGoã®2ã€ã®æãæ·±å»ãªåé¡ã¯ãžã§ããªãã¯ãšäŸåé¢ä¿ã®ç®¡çã§ãã äŸåé¢ä¿ç®¡çãšã¯ããªãªãŒã¹ãŸãã¯ããŒã«ããããæäœããããšã§ãã depããã®åé¡ã®å ¬åŒãœãªã¥ãŒã·ã§ã³ã«ãªãããšãé¡ã£ãŠããŸãã èè ããžã§ããªãã¯ã«å¯Ÿããèªåã®ç«å Žã®ãªãŒãã³æ§ã«ã€ããŠè©±ããŠãããšããäºå®ãèãããšããžã§ããªãã¯ã¯å¿ ç¶çã«ã³ã³ãã€ã«æéãŸãã¯ã©ã³ã¿ã€ã ã®ãããããå¢å ããããããããããã©ã®ããã«å®è£ ããã®ãéåžžã«èå³ããããŸãã
å²Philã®å²åŠ
ããã§ã Simplicity is ComplicatedãšåŒã°ããRob Pikeã®ãã¬ãŒã³ããŒã·ã§ã³ããæãèšæ¶ã«æ®ãåŒçšãäžãããã
äŒçµ±çã«ãããã°ã©ãã³ã°èšèªã¯æ©èœãæ§ç¯ããæ¹æ³ãæ¡çšããŠããŸãã ãããã£ãŠã圌ãã¯çµ¶ããèšåŒµããã³ã³ãã€ã©ãšä»æ§ãè€éã«ããŸãã ãããããã«ç¶ããšãå°æ¥çã«ã¯ãã¹ãŠã®èšèªãã»ãŒåãã«ãªããŸãã è¯ãäŸã¯ãJavaScriptãžã®OOPã®è¿œå ã§ãã äœè ã«ãã£ãŠGoã«æå³çã«å€ãã®ãã®ãå«ãŸããŠããŸããã§ããã ãã®æ©èœã®ã¿ãå®è£ ãããèšèªã®äœè ã®æèŠã®äžèŽããããGoã®æçšæ§ãæ¬åœã«åäžãããæ©èœãå®è£ ãããŸããã
æ©èœã®èŠçŽ ã¯ããœãªã¥ãŒã·ã§ã³ã®ç©ºéã«ãããçŽäº€ãã¯ãã«ã«äŒŒãŠããŸãã ã±ãŒã¹ã«åã£ããã¯ã¿ãŒãéžæã§ããããšãéèŠã§ãã éžæããããã¯ãã«ã¯ãäžå¿ èŠãªåªåãªãã«çžäºäœçšããå¿ èŠããããŸããã€ãŸããèšèªã®æ©èœã®ãã¹ãŠã®èŠçŽ ãäºæž¬å¯èœãªæ¹æ³ã§çµåãããå¿ èŠããããŸãã èšèªæ©èœã®èŠçŽ ã®å®å šãªã»ããã¯ããœãªã¥ãŒã·ã§ã³ç©ºéå šäœãã«ããŒããŠããŸãã ã·ãŒã ã¬ã¹ãªå¯Ÿè©±ã®å¿ èŠæ§ãèæ ®ããŠãããããçš®é¡ã®æ©èœãå®è£ ãããšãèšèªãããã«è€éã«ãªããŸãã ãã ãããã®èšèªã¯ãã·ã³ãã«ã§ç解ããããã€ã³ã¿ãŒãã§ãŒã¹ãæäŸããããšã«ãããè€éããæœè±¡åããŸãã ã·ã³ãã«ãã¯è€éããé ãæè¡ã§ã:)
- èªã¿ãããã®éèŠæ§ã¯ãã°ãã°éå°è©äŸ¡ãããŠããŸãã èªã¿ããããéèŠã§ãã ãœãããŠã§ã¢ãµããŒãã®å¿ èŠæ§ãšäŸ¡æ Œãéåžžã«éèŠã§ãããããããã¯ããããèšèªèšèšã§æãéèŠãªããšã§ãã æ©èœãå€ããããšèªã¿ããããæãªãããŸãã
å¯èªæ§ã¯ä¿¡é Œæ§ãæå³ããŸãã èšèªã®è€éããé«ãå Žåã¯ããããã°ãä¿®æ£ãªã©ãã³ãŒããèªã¿åã£ãŠäœæ¥ããããã«ããå€ãã®ç¥èãšåŽåãå¿ èŠã§ãã ãŸããæ°èŠåå ¥è ã¯ãèšèªã®ç解ãã³ãŒãããŒã¹ã®éçºã«è²¢ç®ãå§ããããšãã§ããã¬ãã«ãŸã§é«ããããã«ããå€ãã®æéãè²»ããå¿ èŠãããããšãæå³ããŸãã
https://blog.digitalocean.com/get-your-development-team-started-with-go/ããååŸ
ã©ãããå§ããã
Goã®é åžãšã€ã³ã¹ããŒã«ã®æé ã¯ãã¡ãã«ãããŸã ã
ãããå ¬åŒã®å ¥éã¬ã€ãã§ãã äŸã§ã¯Goããå§ãããŸãã
æ¬ãå¿ èŠãªå Žåã¯ã Goããã°ã©ãã³ã°èšèªãæé©ãªãªãã·ã§ã³ã§ãã Alan AA DonovanãšBrian W. Kernighanã«ãã£ãŠäœæãããäŒèª¬ã®Cããã°ã©ãã³ã°èšèªãšåã粟ç¥ã§æžãããŠããŸãã
ã³ãã¥ããã£ã¡ã³ããŒãšéä¿¡ãããå Žåã¯ã Gophers Slack Channelã«åå ã§ããŸãã
goã䜿çšãããŠãŒã¶ãŒ
å€ãã®äŒæ¥ã Goãžã®æè³ãéå§ããŸããã æãæåãªãã®ã®ããã€ãã次ã«ç€ºããŸãã
- Google- Kubernetes ã MySQLã¹ã±ãŒãªã³ã°ã€ã³ãã©ã¹ãã©ã¯ã㣠ã dl.google.com ïŒããŠã³ããŒããµãŒããŒïŒ
- BaseCamp- BaseCampã«ç§»å
- CloudFlare- ããã° ã ArsTechnicaã®èšäº
- CockroachDB-CockroachDBã«ãšã£ãŠGoãæ£ããéžæã§ãã£ãçç±
- CoreOS- GitHub ã ããã°
- DataDog- DataDogã«ç§»å
- DigitalOcean- Goã§éçºããŒã ãå§ããŸããã
- Docker- Goã§Dockerãæžãããšã«ããçç±
- Dropbox- Goã©ã€ãã©ãªã®ãªãŒãã³ãœãŒã·ã³ã°
- Parse- APIãRubyããGoã«ç§»è¡ããSanityãä¿åããæ¹æ³
- Facebook- GitHub
- Intel- GitHub
- Iron.IO- çç£ã§2幎åŸ/
- MalwareBytes-golangã§1åããã100äžã®ãªã¯ãšã¹ããåŠçãã/
- Medium- MediumããœãŒã·ã£ã«ã«ãªãæ¹æ³
- MongoDB- GoãšãŒãžã§ã³ã
- Mozilla- GitHub
- Netflix- GitHub
- Pinterest- GitHub
- ã»ã°ã¡ã³ã-GitHub
- SendGrid-Golangã䜿çšããããäŒç€Ÿã説åŸããæ¹æ³
- Shopify- Twitter
- SoundCloud- SoundCloudã«ã¢ã¯ã»ã¹
- SourceGraph- YouTube
- Twitter- 1æ¥50åã»ãã·ã§ã³ããªã¢ã«ã¿ã€ã ã§åŠç
- Uber- ããã° ã GitHub
ããã°ã©ã ã«è¡ãïŒ
ãæéãããã ãããããšãããããŸãã ãã®èšäºãæ°ã«å ¥ã£ãããTwitter / Facebookã§åéãšãªã³ã¯ãå ±æããŠãããŠãšãŠãæè¬ããŠããŸãã Twitterã§ç§ãèŠã€ããããšãã§ããŸãïŒ https : //twitter.com/kanishkdudeja
åç §ïŒ
- ãªãªãžãã«ïŒ Goã®çŸãã ã