Golang x509无法在Mac OS X上加载系统根目录错误

时间:2014-10-31 14:25:15

标签: macos go

我在本地计算机上发出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"

1 个答案:

答案 0 :(得分:0)

你需要安装go from homebrew without cgo:

brew remove go
brew install go --without-cgo