macos - 无法在 mac os 上使用 Go 命令行

标签 macos go

我想使用命令go get,但它抛出异常

enter image description here

但我已经安装了命令行工具。

enter image description here

系统:macOs sierra 10.12.6

Go:1.9.2

编辑: 错误信息:

go get github.com/hashicorp/go-plugin
# cd .; git clone https://github.com/hashicorp/go-plugin 
/Users/famoss/files/goworkspace/src/github.com/hashicorp/go-plugin xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
package github.com/hashicorp/go-plugin: exit status 1

最佳答案

尝试 this question 的建议之一:

  • 选择您要使用的 XCode 版本(直接在 XCode 首选项中)
  • 或尝试建议的sudo xcode-select --switch path/to/Xcode.app
  • 或尝试 sudo xcode-select --reset

另请参阅“git push xcrun: error: active developer path does not exist”以了解替代方法。

关于macos - 无法在 mac os 上使用 Go 命令行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46985880/

相关文章:

c++ - 如何在 OS X 上使用 QSettings 存储 INI 文件

ios - 如何从该 LAN 上的 IP 地址解析我 LAN 中设备的主机名?

go - 需要与Makefile一起使用多个Go版本

Golang 无法从 panic 中恢复 mgo.DialWithInfo

go - 如何在 Go 中获取计算机的当前语言?

xcode - 禁用 NSTableCellView 单击编辑

cocoa - 用 cocoa 复制照相亭屏幕闪光灯

macos - 在 Mac OS X 上查找已挂载网络共享的路径

google-app-engine - Golang 中的变量内部定义模板

go - 如何将Go的GC CPU使用率提高到25%以上?