英文:
Golang x509 Failed to load system roots error on Mac OS X
问题
我在本地机器上进行API调用时遇到了一个错误。
x509: failed to load system roots and no roots provided
go env:
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/usr/local/Cellar/go/1.3.3"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.3.3/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.3.3/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
英文:
I am getting an error making api calls on my local machine.
x509: failed to load system roots and no roots provided
go env:
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/usr/local/Cellar/go/1.3.3"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.3.3/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.3.3/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
答案1
得分: 0
你需要使用Homebrew安装不带cgo的Go语言,可以按照以下步骤进行操作:
- 移除已安装的Go语言:
brew remove go
- 安装不带cgo的Go语言:
brew install go --without-cgo
请注意,这些命令需要在终端中执行,并确保已经安装了Homebrew。
英文:
You need to install go from homebrew without cgo:
brew remove go
brew install go --without-cgo
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论