vscode 中设置 SSH中的 GOPATH
环境:
win10机器上的vscode,ssh连接到了linux机器,编写linux系统中的go代码,一直用go mod,碰到了不使用go mod的代码, 没有设置GOPATH,使得import依赖找不到
解决办法:
在 /etc/profile 中或者 ~/.bash_profile 中加入 export GOPATH=$GOPATH:/goProject/Hello
,然后需要使得这个文件生效,source 试了下不太管用,因为需要重新启动vscode,重启下linux系统就好。