vscode配置go环境
文件–>首选项–>设置
{
"go.buildOnSave": true,
"go.buildFlags": [],
"go.buildTags": "",
"go.lintOnSave": true,
"go.formatOnSave": true,
"go.gopath": "E:\\gohmoe",
"go.goroot": "C:\\go"
}
go run 文件名
{
"version": "0.2.0",
"configurations": [
{
"name": "LaunchGo",
"type": "go",
"request": "launch",
"mode": "auto",
"remotePath": "",
"port": 5546,
"host": "127.0.0.1",
"program": "${fileDirname}",
"env": {
"GOPATH": "E:/GoCode",
"GOROOT": "C:/Program Files/Go"
},
"args": [],
//"showLog": true
}
]
}
F5