英文:
GO permissions issue for Visual Studio Code (MAC OS Big Sur 11.3.1)
问题
我想知道你是否可以帮助我解决我最近一直在苦苦挣扎的问题。
我最近安装了Visual Studio Code和GO,以便在几个项目上进行工作,但在尝试下载GO扩展程序时遇到了以下错误:
安装github.com/fatih/gomodifytags@latest失败
{
"killed": false,
"code": 1,
"signal": null,
"cmd": "/usr/local/go/bin/go install -v
github.com/fatih/gomodifytags@latest",
"stdout": "",
"stderr": "go: could not create module cache: mkdir /Users/go:
permission denied\n"
}
每次尝试在我的IDE上安装与GO相关的文件时,都会遇到权限拒绝的问题。
英文:
I was wondering if you could help me with this issue I've really been struggling with recently.
I have recently installed Visual Studio Code and GO in order to work on a few projects and I have run into this error when attempting to download the GO extensions for my IDE;
Installing github.com/fatih/gomodifytags@latest FAILED
{
"killed": false,
"code": 1,
"signal": null,
"cmd": "/usr/local/go/bin/go install -v
github.com/fatih/gomodifytags@latest",
"stdout": "",
"stderr": "go: could not create module cache: mkdir /Users/go:
permission denied\n"
}
Every single attempt to install a GO related file on my IDE has been met with a permissions denial.
答案1
得分: 2
sudo chown -R your_name:admin $((go env GOROOT))
将上述命令翻译为中文如下:
sudo chown -R your_name:admin $((go env GOROOT))
请注意,这是一个命令,用于更改文件或目录的所有者。在这个命令中,your_name应替换为你的用户名,admin应替换为所需的组名。$((go env GOROOT))是一个变量,表示Go语言的根目录路径。
英文:
sudo chown -R your_name:admin $((go env GOROOT))
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论