gpt4 book ai didi

go - 找不到 asdf 安装的 "go"二进制文件

转载 作者:行者123 更新时间:2023-12-05 01:53:06 28 4
gpt4 key购买 nike

使用 asdf 安装 Go 并尝试打开 Go 项目后出现以下错误。

Failed to find the "go" binary in either。GOROOT() or PATH(/usr/bin:/bin:/usr/sbin:/sbin). Check PATH, or Install Go and reload the window.

最佳答案

我通过重启 VSCode 解决了这个问题。

另一个人也在 this issue 中提出了修复建议我不需要这样做。

  1. Shift + Cmd + P
  2. 搜索:“打开设置”并选择“打开设置 (JSON)”
  3. 运行 go env 并复制 GOROOT 值(在我的例子中是 /opt/homebrew/Cellar/go/1.17.1/libexec)。
  4. 将新记录添加到 settings.json:
"go.goroot": "Copied/GOROOT/path",

在我的例子中是:

"go.goroot": "/opt/homebrew/Cellar/go/1.17.1/libexec"

关于go - 找不到 asdf 安装的 "go"二进制文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71241347/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com