dongyuan2388
2017-07-15 00:16 阅读 334
已采纳

vscode将终端gopath设置为匹配go.gopath

I have a Go project that I'm maintaining with vscode.

I have set the GOPATH for the project using the go.gopath setting in vscode, and this seems to work just fine for the most part.

However, when I open the integrated terminal, and type echo $GOPATH, the value shown is the value from .bashrc not the value from go.gopath.

I need the integrated terminal to respect the GOPATH that's defined by vscode so when I run commands in the terminal, everything runs properly.

I've tried setting values in terminal.integrated.shell.osx and terminal.integrated.shell.osx, but nothing seems to do what I want.

I want the intergrated terminal to understand the proper GOPATH when vscode is opened, and not have to manually set this each time I open an instance of the terminal.

I've found resources that seem like the should work, such as https://github.com/Microsoft/vscode/issues/14973 and many others, but nothing seems straight forward.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    dongzhenyin2001 dongzhenyin2001 2017-07-15 16:36

    VSCode uses go.gopath i used for tools like go vet and go import... You will have to export the GOPATH on the integrate terminal with each use or set it in the bashrc... the integrate terminal is just a "clone" of the systems actual terminal. If you read the thread you provided you'll notice that what you want is a feature requests and not a current feature

    点赞 评论 复制链接分享

相关推荐