You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Lorcaï¼SvelteKitã§ãã£ã¦ã¿ãï¼ https://github.com/zserge/lorca https://github.com/sveltejs/kit ãããããå¿ è¦ãªãã® go(version 1.17.2以é) nodejs(16.9.0以é),npm(7.21.1以é) Chrome/Chromium/Edgeã®ãããã ããã¸ã§ã¯ãã®éå§ mkdir sample-gui cd sample-gui go mod init sample-gui npm init svelte@next frontend // Choice "Svelte app template" is "Skelton Project". // Choice "Use TypeScript" is No. // Choice "ESLint" is No. // Choice "Prett
ããã«ã¡ã¯ã@p1assã§ãã æè¿ç 修㧠Go ãæ¸ãã¦ãã¦ããã®éã«ããã¤ã質åããããã®ã§ãããèãã¦ã¿ãã¨åã«ãçãããããªè³ªåãå¤ãã£ãã®ã§ããããæ©ã«ããã°ã«åèãªã³ã¯ãã¾ã¨ãããã¨æãã¾ãã 質åãããéã«ããçããããªã質åãæ°å¤ãããã調ã¹ããæãã¦ããã£ãããããã¨ã§æ§ã ãªãã¨ãåçºè¦ã§ãã¾ããã ãã®è¨äºã§ã¯ã質åã«å¯¾ããåçãã§ããã ãå ¬å¼ã«è¿ãæç« ãå¼ç¨ããå½¢ã§æ¸ãè¨ãã¾ããç§å人ã®èãã¯å¥ã®æ®µè½ã«ãªãããã«ãã¦ãäºå®ã¨æè¦ãåºå¥ããããã«å¿ããã¦ãã¾ãã ãªã«ã誤ããè¦ã¤ããé㯠GitHub 㧠PR ãæãã¦ããã ããã¨å©ããã¾ãã è¨èªä»æ§ é¢æ°ã®å¼æ°ã¯å¤æ¸¡ããåç §æ¸¡ããï¼ Go ã¯ãã¹ã¦å¤æ¸¡ã (pass by value) ã§ãã ãã¤ã³ã¿ã®å ´åã¯ããã¤ã³ã¿ãã®ãã®ãã³ãã¼ãããã¤ã³ã¿ã®æã示ãå ã®å¤ã¯ã³ãã¼ããã¾ããã Go ã®å¤å¤è¿å´ã¯ã¿ãã«ãï¼
Goã®ã¨ã©ã¼ãã³ããªã³ã°ãæ¡ã£ãã¹ã¿ã¤ã« å¤å¤è¿ã ç´ç©ï¼é¢æ°ã®è¿å¤ã¨ã¨ã©ã¼ã両æ¹è¿ãï¼ try-finallyãdeferã¨ããæ©æ§ã§ã«ãã¼ panicã¯ããã»ã¹ãè½ã¨ãããã®ãã® Goã¯ãã®æ¦ç¥ã§ã¨ã©ã¼ãã³ããªã³ã°ãè¡ãã¨ãã¾ããã®ã§ããå¤å¤ã¯ãªãã¿ãã«ãããªããã ï¼ãããç´åï¼è¿å¤orã¨ã©ã¼ï¼ã§ååããï¼ããpanic-recoverã§try-catchã§ãããï¼ããªã©ããæ§ãªä»ã®å¦çç³»ã®é¢¨ç¿ãæã¡è¾¼ããã¨ã¯æå³ãããã¾ãããããã¦ãããã®ææ¡ã®å¤ãã¯ãã§ã«æ¤è¨ãããªã¸ã§ã¯ãããã¦ããçµç·¯ãããã¾ãã ãtryçµã¿è¾¼ã¿é¢æ°ããããã¼ã¶ã«ãªãããæ¤è¨ãããã¼ã¸ç´åãããã¾ã§é²ãã ãã¨ãããã¾ããããGoã®ã¨ã©ã¼ãã³ããªã³ã°ãã«ã¨ã£ã¦ä¸é·ä¸çãããã¾ããããã®æ¬ ç¹èª²é¡ã¯è§£æ±ºã§ããã«æçµçã«ãªã¸ã§ã¯ãããã¾ããã ãå¤å¤è¿ããã¯å®ã«CPUãã¬ã³ããªã¼ãªæ©æ§ã§ãCè¨èªã®é¢æ°å¼ã³åºãè¦ç´ã«ã¡ã
Goã®ããã¸ã§ã¯ããã©ã®æ§ãªãã¡ã¤ã«æ§æã§é ç½®ããã°è¯ããèªã¿ç©ãå°ãªãã¨ããææãè¦ãã®ã§ã¾ã¨ãã¦ã¿ããã¨æãã GOPATHã«ã¤ã㦠Go1.16ããªãªã¼ã¹ããããã¨ã§Go-Moduleã«ããããã¸ã§ã¯ãæ§æãæ¨æºã§æ¨å¥¨ããããã¨ã«ãªãã¾ãããï¼Go1.11ã¾ã§ããã®ã¼ã£ã¦Go-Moduleã¯ä½¿ããæ§ã«ãªã£ã¦ã¾ãï¼ Go-Moduleã¢ã¼ãã§ã¯ãGOPATHé ä¸ã«ããã¸ã§ã¯ããç½®ããªããã°ãªããªããã¨ããå¶ç´ããã¯è§£æ¾ããã¦ãã¾ãããªã®ã§ãå®è³ªGOPATHã¯ã©ããæãã¦ãã¦ãæ§ããªããè¨å®ããã¦ããªãã¦ããã¦ã¼ã¶ã¼ãã¼ã /goãã¨ããããã©ã«ãã®å ´æã決ã¾ã£ã¦ããã®ã§éçºã§ãã¾ãã ããããã®ç°å¢å¤æ°è¨å®ã¯ä»¥ä¸ã®ï¼ã¤ã ãã ãGOPATH=~/.goãï¼Windowsã¯GOPATH=ï¼ USERPROFILE%\.goï¼ ãPATH=ï¼GOPATH/bin:$PATHãï¼Windowsã¯
ã¢ããªã±ã¼ã·ã§ã³ãçºè¡ããSQLã«ã³ã¡ã³ããåãè¾¼ããã¨ä¾¿å©ã§ããä¾ãã°ã /* path/to/logic.go:334 */ SELECT ... ã®ããã«SQLã«çºè¡å ã®æ å ±ãã³ã¡ã³ãã¨ãã¦åãè¾¼ãã§ããExecããã°ãDBå´ã®ãã°(general logç)ã«ãè¨é²ããããããSREãDREãµã¤ãããããè² è·ã®é«ãSQLãã¢ããªã±ã¼ã·ã§ã³ã®ã©ãããçºè¡ããã¦ããããåããããããªãã¾ãã Goã«ã¯ github.com/shogo82148/go-sql-proxy ã¨ãããSQLå®è¡ããã¬ã¼ã¹ããããã¯å¦çãå·®ãè¾¼ãã便å©ãªã©ã¤ãã©ãªãããã¾ãããä»åããã«pull requestãéã£ã¦ãSQLå®è¡åã«ã¯ã¨ãªã®æ¸ãæããã§ããããã«ãã¾ããã https://github.com/shogo82148/go-sql-proxy/pull/61 https://github.co
ããã«ã¡ã¯ãm3 ã¨ã³ã¸ãã¢ãªã³ã°ã°ã«ã¼ã CTO ç¢å´(id:Saiya)ã§ãã éå»ã« Go è¨èªã®ä»æ§ãä¸éãè¦ãçµé¨ããã£ãã®ã§ãããä¹ ãã¶ãã« Go ã®ã³ã¼ããæè¿èªã¿æ¸ãããéã«ãããæ°å¹´ã® Go è¨èªãã¨ã³ã·ã¹ãã ã®é²åã«ããå¤åããããçºè¦ãããããå¤ã ããã¾ããã Go è¨èªå ¬å¼ã®ãã´ãã¹ãã¼ãæããã¾ããã åããããªè¿·ãã»åãéããã¦ãã¾ãæ¹ãããããããããããã®ã§ã¯ãªããã¨æãã¾ãããã ã¨ã ã¹ãªã¼ Advent Calendar 2020 6 æ¥ç®ã®è¨äºã¨ãã¦ãçè ãå®éã«ãæåããç¥ã£ã¦ããã°æéãç¡é§ã«ããªãã£ãã®ã«...ï¼ãã¨æããç¥è¦ããã£ãã°ããã«ã·ã§ã¢ãããã¾ãã æ¬è¨äºãã©ãªããã®ä¸å©ã«ãªãã¾ãã¨å¹¸ãã§ãã ãªãæ¬è¨äºã®å 容ã¯çè å人ã®ç解ã»èªèº«ã§ç´æ¥èªã¿æ¸ãããã¦ã¼ã¹ã±ã¼ã¹ã®ç¯å²ã§ã®ç¥è¦ã§ãããå ¨ã¦ã® Go å©ç¨äºä¾ã«å½ã¦ã¯ã¾ããªãç¹ãå«ã¿ããã¾
ã¯ããã« æè¿ã¤ã±ã¤ã±ãªGoï¼ ã§ããã¿ã¼ãªGoããã¸ã§ã¯ãã®ã¯ããããã£ã¦ãã¾ãã¡èª¿ã¹ã¦ãããããªãã§ãããã èªåã¯æåè²ã è¿·ãã¾ãããã ã¾ãããã±ã¼ã¸ç®¡çãã¼ã«ã godepã ã£ããGo Modulesã ã£ãããå°ãæ å ±ãã¨ã£ã¡ããã£ã¦ããå°è±¡ã§ãã å¾ã¯ã©ã®ãã£ã¬ã¯ããªã«ããã¸ã§ã¯ããé ç½®ããæ¹ãããã®ãããããã¥ããã importã®ä»æ¹ãç¸å¯¾ã¨çµ¶å¯¾ã®ã©ã¡ããããã®ãè¿·ãã ã¨ããããã§ä»¥ä¸ã®4ç¹ã«çµã£ã¦è§£èª¬ãã¦ããããã¨æãã¾ãï¼ ããã±ã¼ã¸ç®¡çãã¼ã« ããã¸ã§ã¯ãã®é ç½®å ´æ èªä½ããã±ã¼ã¸ã®importã®ä»æ¹ ããããã©ã¤ãã©ãª ãã®è¨äºãèªãã°æ£ããGoããã¸ã§ã¯ããä½æã§ãã¾ãï¼ï¼ãã¶ãï¼ ã追è¨ã ã¤ã³ã¹ãã¼ã«æ¹æ³ã¨VSCodeã®è¨å®ã«é¢ãã¦ãç°¡æ½ã«ã¾ã¨ããã®ã§ãè¯ãã£ããåèã«ãã¦ãã ããã ãè¶ ç°¡åãGoã®ã¤ã³ã¹ãã¼ã«ã¨VSCodeè¨å®æ¹æ³ ãããªãã¾ã¨ã ããã¸
golang-migrateã¨ã¯ï¼ Goè¨èªã§ä½æãããDBãã¤ã°ã¬ã¼ã·ã§ã³ãã¼ã«ã§ãGOè¨èªã®ã©ã¤ãã©ãªã¨ãã¦ã ãã§ã¯ãªããCLIãããå©ç¨ã§ãã¾ãããã®ããJavaã§éçºããã¦ããprismatixã¨ãããµã¼ãã¹ã§ãå©ç¨ãããã¨ãã§ãã¾ãã Javaã®ãã¤ã°ã¬ã¼ã·ã§ã³ãã¼ã«ã«Flywayãliquibaseã¨ãã£ããã®ãããã¾ãããã®ä¸ã§ãã®ãã¼ã«ã®ç¹å¾´ã¯ããã¤ã°ã¬ã¼ã·ã§ã³ãå®ç¾©ãã¦ãããã¡ã¤ã«ãGitHubãAWS S3ãªã©ããç´æ¥åç §ãããã¨ãã§ãããã¨ã§ãã(ãã¡ãããã¼ã«ã«ã®ãã¡ã¤ã«ã·ã¹ãã ã«ã対å¿ãã¦ãã¾ã) ã¾ã対å¿ãã¦ãããã¼ã¿ãã¼ã¹ã¨ã³ã¸ã³ãå¤ããMySQLãPostgreSQL以å¤ã«ãMongoDBãªã©ã«ã対å¿ãã¦ãããªã©ãæ§ã ãªå ´é¢ã§ä½¿ããã¨ãã§ãããã¼ã«ã ã¨æãã¾ãã ç°å¢æ§ç¯ ä»åã¯æ軽ã«è©¦ãããã«dockerä¸ã§ãgolang-migrateã¨PostgreS
ãããããGoè¨èªã§ã¤ããã¤ã³ã¿ããªã¿ããã°ã©ã³ããã£ãã¼ã¬ãè¿ããã ããã¦ãããã§çµããã ãããéãããããã¾ã§ã¯ç§ãèªãå°ããªãç¥ãã軽ããããã£ã¦ããã¨ãã¦ããããããæå¿«ãªãã¼ãã£å¸½ã被ã£ã¦ããæéã ã æç²:: Thorsten Ball âGoè¨èªã§ã¤ããã¤ã³ã¿ããªã¿â ãã£ãã¼ããã¼ãã£ã¼ã ï¼ ãªãã§ãã®æ¬ãèªãã ã®ï¼ ä»ã¾ã§ã³ã³ãã¥ã¼ã¿ãµã¤ã¨ã³ãã¾ã¨ãã«å¦ãã ãã¨ããªãã£ãã 大å¦çã®æåãææ¥ã§ã¯ãããã°ã©ãã³ã°ãã¨éæã¤ãã®ããããããã§ã Javaã§ã¢ãã¬ãããä½ã£ãããCã§ã·ã¹ãã ããã°ã©ãã³ã°ããããã¨ããç¨åº¦ã ã£ãã ãã¨ã¯ç¬å¦ãããã¾ã§ç®çéæã®ããã®å¦ç¿ã GUIãWebã¢ããªã®é«ã¬ã¤ã¤ã¼ã®å®è£ ã°ããã§ã ä¸ãã©ããªã£ã¦ãã®ãããã¾ãç解ã§ãã¦ãªãã£ãï¼ããããé»åå·¥ä½ã¯å¥½ãã ã£ããã©ï¼ã ã§ããªãã¨ããã£ã¦ãããã ãã©ã ã³ã³ãã¥ã¼ã¿ãµã¤ã¨ã³ã¹ãå¦ãã§ã
ï¼æ ªï¼ã©ã¤ãã³ã¼ãã®ç¬¹å·ï¼ããããï¼ã§ãï¼ ååã¯ãRESR APIãæ§ç¯ããããã®æ©è½ãå®è£ ãã¾ããã ä»åã¯ãPOSTã§åãåã£ãå¤ãFirestoreã¸è¿½å ãã追å ããããã¼ã¿ãã¬ã¹ãã³ã¹ã¨ãã¦è¿ãå®è£ ããã¦ã¿ããã¨æãã¾ãã 1func firebaseInit(ctx context.Context) (*firestore.Client, error) { 2 // Use a service account 3 sa := option.WithCredentialsFile("path/to/serviceAccount.json") 4 app, err := firebase.NewApp(ctx, nil, sa) 5 if err != nil { 6 log.Fatalln(err) 7 return nil, err 8 } 9 10 client, err :
LGTM ã¨ã¯ LGTM ã¯ãã³ã¼ããåæããããã®ãã¼ã«ã§ãã https://lgtm.com/ CodeQL ã¨ããæè¡ã使ã£ã¦ãã½ã¼ã¹ã³ã¼ãã«å¯¾ãã¦ã¯ã¨ãªãæãããã¨ã§ãä¾ãã°èå¼±æ§ã®ãããããªã³ã¼ãã®ãã¿ã¼ã³ããä¸å ·åã®ãããããªã³ã¼ããè¦ç´ãæºããã¦ããªãã³ã¼ããªã©ãæ¤æ»ãããã¨ãã§ãã¾ãã ã³ã¼ãã«å¯¾ãã¦æ¤æ»ãããããããããã¯ä»¥ä¸ã®ãµã¼ãã¹ã¨é£æºãã¦ãã«ãªã¯ã¨ã¹ãã«å¯¾ãã¦æ¯åæ¤æ»ãè¡ããã¨ãå¯è½ã§ãã Bitbucket Cloud GitHub.com GitLab.com è¨èªã«ã¤ãã¦ã¯ä»¥ä¸ã«å¯¾å¿ãã¦ããã¨ã®ãã¨ã§ãã C and C++ C# Go, also known as Golang Java JavaScript/TypeScript Python CodeQL ã«ã¤ã㦠CodeQL is the code analysis platform used b
1package main 2 3import ( 4 "fmt" 5 6 _ "github.com/go-sql-driver/mysql" 7 "github.com/jinzhu/gorm" 8) 9 10func main() { 11 _, err := sqlConnect() 12 if err != nil { 13 panic(err.Error()) 14 } else { 15 fmt.Println("DBæ¥ç¶æå") 16 } 17} 18 19// SQLConnect DBæ¥ç¶ 20func sqlConnect() (database *gorm.DB, err error) { 21 DBMS := "mysql" 22 USER := "go_example" 23 PASS := "12345!" 24 PROTOCOL := "tcp(localh
ã©ãããmoriã§ãã AWS SDK for Goã使ãéçºã§éçºç°å¢ (IDE)ã¨ãã¦AWS Cloud9ã使ã£ã¦ã¿ãã®ã§ãä½ææ¹æ³ã¨å®éã«ã³ã¼ããæ¸ãã¦ãããã°å®è¡ããã¨ããã¾ã§ãç´¹ä»ãããã¨æãã¾ãã AWS Cloud9æ¦è¦ ãã©ã¦ã¶ã®ã¿ã§ã³ã¼ããè¨è¿°ãå®è¡ããããã°ã§ããã¯ã©ã¦ããã¼ã¹ã®çµ±åéçºç°å¢ (IDE) ã§ãã ã³ã¼ãã¨ãã£ã¿ ãããã¬ã¼ ã¿ã¼ããã« ãå å ããã¦ãããå¤ãã®è¨èªãã¼ã«ããµãã¼ãããã¦ãã¾ãããµãã¼ãããã¦ãããã©ã¦ã¶ã¯ãGoogle ChromeãSafariãFirefoxãMicrosoft Edge ã®ææ°ãã¼ã¸ã§ã³ã§ãã 大ããªç¹å¾´ã¨ãã¦ã以ä¸ãæãããã¾ãã ãã¢ããã°ã©ãã³ã°ãµãã¼ãããµãã¼ããã¦ãã éçºç°å¢ããã¼ã ã¨å ±æãããã¢ããã°ã©ãã³ã°ãä¸ç·ã«è¡ããã¨ãã§ãã¾ãã ãªã¢ã«ã¿ã¤ã ã§ç¢ºèªã§ããã®ã§ãæ ç¹ã®é¢ããã¡ã³ãã¼ã¨ããããããã
jqã¯ã¨ã¦ã便å©ãªã³ãã³ãã§ãã JSONãè¿ãAPIãå®è£ ããã¨ãããSaaSã®APIããç¹å®ã®æ å ±ãæãåºãã¦ã·ã§ã«å¤æ°ã«ä»£å ¥ããã¨ããªã©ãwebéçºãéç¨ã«ã¯æ¬ ãããªããã¼ã«ã¨ãªã£ã¦ãã¾ãã ããããç§ã«ã¨ã£ã¦jqã®ã¯ã¨ãªãä¸çºã§æ¸ãã®ã¯å®¹æã§ã¯ãªããæãéãã®åºåãå¾ãããªããã¨ãããããã¾ããã é£ããã¨ã©ã¼ã¡ãã»ã¼ã¸ã«æ©ã¾ããã¦ãjqã§æ¸ãã®ã諦ãã¦å¥ã®è¨èªã§æ¸ãç´ããã¨ãããã¾ããã jqã®åå «çªã¨æããå ´é¢ã§ä½¿ãããªããªãã®ã¯ããªããªãæãããã®ãããã¾ãã ãã¼ã«ã使ãã®ãé£ãããªããåããã®ãä½ã£ã¦ãã¾ãã°ããã®ã§ãã jqã®å ¨ã¦ã®æ©è½ãå®è£ ãã jqãè¨èªã¨ãã¦ãã¡ãã¨æ¸ããããã«ãªã jqãå®å ¨ã«ç解ãã jqã®å ¨ã¦ã®æ©è½ãèªåã§å®è£ ãã¦ãã¾ãã°ãjqãã©ããããã®ããã¯ã¨ãªãã©ã®ããã«å¦çãããã®ãã詳ãããªããã¯ãã§ãã jqãå¾æãªè¨èªã¨è¨ããããã«ãªã£ã¦ãã¯
ããã«ã¡ã¯ãCXäºæ¥æ¬é¨ã®å¤ç®ã§ãã Golangã¯æè¿äººæ°ã®è¨èªã§æãåºããã¨ã¯æã£ã¦ããã®ã§ãããç°å¢æ§ç¯ããã¾ãã¡ããããããªãã¦ã§ãã¦ã¾ããã§ããã (goenvã使ã£ã¦Golangãã¤ã³ã¹ãã¼ã«ããã¨ãGOPATHã¯ã©ããããããã¨ãããããããªãã£ãã®ã§ã) ä»æ¥ã¯VisualCodeã¨Dockerã使ã£ã¦ãGolangã®éçºç°å¢ãMacä¸ã«ä½æãããã¨æãã¾ãã ç°å¢æ§ç¯ äºåæºå VSCodeã¨Dockerãã¤ã³ã¹ãã¼ã«ãã¾ãã Visual Studio Code - Code Editing. Redefined Docker Desktop for Mac and Windows | Docker Version 2.0ä»¥ä¸ æ¡å¼µæ©è½ã®ã¤ã³ã¹ãã¼ã« VSCodeã®Extension "Remote-Containers"ã使ç¨ãã¦éçºç°å¢ãä½ããã¨æãã¾ãã Micr
tl;dr go/types ããã±ã¼ã¸ããã¡ããã¡ãä¾¿å© https://golang.org/pkg/go/types/ https://github.com/golang/example/tree/master/gotypes gouml ã®ç´¹ä» Goã®ã³ã¼ããéç解æããPlantUMLã®ã³ã¼ããåããã¼ãµãéçºãã¦ããã github.com ä¾ãã°Goè¨èªã§æ¸ããããã®ã½ã¼ã¹ãã¡ã¤ã«ã渡ãã¨ã package main type Human struct { Name string Age Age } type Age int func (a Age) IsAdult() bool { return a >= 20 } 以ä¸ã®ãã㪠PlantUML ã³ã¼ããçæãããã package "main" { class "Age" as main.Age <<V,Orchid>>
æåããå®ç§ãªè¨è¨ã¨å®è£ ãã§ãã¦ãããªãè¦å´ã¯ãªãããã ãã©ãå®éã«ã¯ããããããªããå ·ä½çã«ã¯ããç¨åº¦ã®è¦æ¨¡ã«ãªã£ã¦ããã¨ããã¼ãã®é¢æ° context.Context 対å¿ãããï¼ãã¿ãããªæ°æã¡ã湧ãã¦ããããã§ããcontext 対å¿ã£ã¦ã®ã¯ã第ä¸å¼æ°ã« ctx context.Context ã追å ãããã¨ã§ããã ãããããã¨ããããã¼ã«ãæ¸ãã¾ããã GitHub - motemen/go-ctxize: Rewrite functions to have "Context"s go get github.com/motemen/go-ctxize/cmd/goctxize ã§ãgoctxize ã¨ãããã¤ããªãæã«å ¥ãã¾ãã ãµã³ãã« README ããã¹ãã«ããä¾ã ãã©ã // $GOPATH/src/example.com/foo/foo.go package foo
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}