不久前我已经切换到 Go。我选择 JetBrains Gogland 作为 IDE。我喜欢两者:Go 和 IDE,除了一个问题。我不知道这是 IDE 问题还是 macOS Sierra 上的 Go lang 配置问题。但是当我尝试从 Gogland 开始调试测试时,构建失败并显示消息:
GOROOT=/usr/local/go
GOPATH=/Users/username/project/go
/usr/local/go/bin/go test -c -i -o /private/var/folders/3b/hlrss45s1p93cgtq9xgsw4gh0000gn/T/All_in__bitbucket_org_ username_package_matrix_go -gcflags "-N -l" -a bitbucket.org/usaername/package/matrix
go install runtime/internal/sys: open /usr/local/go/pkg/darwin_amd64/runtime/internal/sys.a: permission denied
我使用 Go 1.9
$ go version
go version go1.9 darwin/amd64
$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/azagretdinov/project/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.9/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.9/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/3b/hlrss45s1p93cgtq9xgsw4gh0000gn/T/go-build006508560=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
戈格兰的资料
Gogland (1.0 Preview) 1.0 EAP
Build #GO-172.3757.46, built on August 11, 2017
Gogland EAP User
Expiration date: November 9, 2017
JRE: 1.8.0_152-release-915-b10 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6