英文:
vscode set terminal gopath to match go.gopath
问题
我有一个使用vscode维护的Go项目。
我已经使用vscode中的go.gopath
设置为项目设置了GOPATH
,在大部分情况下这似乎都工作正常。
然而,当我打开集成终端并输入echo $GOPATH
时,显示的值是来自.bashrc
而不是go.gopath
的值。
我希望集成终端能够遵守由vscode定义的GOPATH,这样当我在终端中运行命令时,一切都能正常运行。
我尝试过在terminal.integrated.shell.osx
和terminal.integrated.shell.osx
中设置值,但似乎没有达到我想要的效果。
我希望在打开vscode时,集成终端能够正确理解GOPATH,并且不必每次打开终端实例时手动设置它。
我找到了一些看起来应该能够解决问题的资源,例如https://github.com/Microsoft/vscode/issues/14973和其他许多资源,但似乎没有一个直接的解决方法。
英文:
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
得分: 0
VSCode使用go.gopath,我用它来进行诸如go vet和go import之类的工具...您将需要在集成终端中每次使用时导出GOPATH,或在bashrc中设置它...集成终端只是系统实际终端的“克隆”。如果您阅读您提供的线程,您会注意到您想要的是一个功能请求,而不是当前的功能。
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论