dongyuan2388 2017-07-15 00:16
浏览 693
已采纳

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 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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 phython如何实现以下功能?查找同一用户名的消费金额合并—
  • ¥15 孟德尔随机化怎样画共定位分析图
  • ¥18 模拟电路问题解答有偿速度
  • ¥15 CST仿真别人的模型结果仿真结果S参数完全不对
  • ¥15 误删注册表文件致win10无法开启
  • ¥15 请问在阿里云服务器中怎么利用数据库制作网站
  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址