GO permissions issue for Visual Studio Code (MAC OS Big Sur 11.3.1)

huangapple go评论91阅读模式
英文:

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

huangapple
  • 本文由 发表于 2021年11月24日 19:17:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/70095120.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定