英文:
reset workspace env
问题
我意外地点击了Visual Studio Code中的"Go: reset workspace env",导致本地的Go环境无法工作。
我的Go版本是1.18。
> 运行'/usr/local/go/bin/go env'失败(当前工作目录:/Users/kejie/go/ms):错误:命令运行失败:/usr/local/go/bin/go env -json GOPATH GOROOT GOPROXY GOBIN GOMODCACHE
提供给GOWORK的路径必须是绝对路径
>
> 提供给GOWORK的路径必须是绝对路径
➜ go env
> 提供给GOWORK的路径必须是绝对路径
英文:
I accidentally clicked Go: reset workspace env in Visual Studio Code, and the local Go environment won't work
My Go version is 1.18
>Failed to run '/usr/local/go/bin/go env' (cwd: /Users/kejie/go/ms): Error: Command failed: /usr/local/go/bin/go env -json GOPATH GOROOT GOPROXY GOBIN GOMODCACHE
the path provided to GOWORK must be an absolute path
>
>the path provided to GOWORK must be an absolute path
➜ go env
>the path provided to GOWORK must be an absolute path
答案1
得分: 1
echo $GOWORK
是什么意思?如果不为空,请在命令行中重置它,例如unset GOWORK
,然后使用新的环境变量重新启动vscode。
如果用户配置文件或工作区的settings.json中有go.toolsEnvVars
字段,请尝试删除该字段并重新启动vscode。
英文:
- What does
echo $GOWORK
say? Reset it if not empty from the commandline e.g.unset GOWORK
, and relaunch vscode with the new env var. - If user profile or workspace settings.json has
go.toolsEnvVars
field, try to delete the field and restart vscode.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论