这是我第一天使用带有beego的vscode。 我使用了IntelliJ,它有一个设置来指定GOPATH的自定义路径。
Vscode似乎没有允许多个GOPATH的选项,我想我可以尝试为所有集成终端会话附加GOPATH
变量。
我已在settings.json
"terminal.integrated.env.osx": {
"GOPATH": "/Users/hk/go:/Users/hk/Documents/code/go/go-beego"
}
但是,它对tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "go: run beego",
"type": "shell",
"command": "echo \"gopath is $GOPATH\" | bee run portal"
}
]
}
任务输出
gopath is /Users/hk/go
FATAL ▶ 0001 No application 'portal'
found in your GOPATH.
The terminal process terminated with exit code: 255
编辑:集成终端不遵守以下规定:
"go.gopath": "/Users/hk/go:/Users/hk/Documents/code/go/go-beego",