菜單欄Tasks->Configure Tasksshell
{ "version": "2.0.0", "tasks": [ { "label": "Build logic", "type": "shell", "command": "go build src/service/main.go", "group": { "kind": "build", "isDefault": true }, "problemMatcher":{ "owner": "go", "fileLocation": [ "relative", "${fileDirname}" ], "pattern": { "regexp": "^(.*):(\\d+):\\s+(.*)$", "file":1, "line": 2, "message": 3 } } } ] }
vscode編譯快捷鍵 ctrl+shitf+bui