无法在 macOS Sierra 上的 Gogland 1.0 EAP 中启动调试。

huangapple go评论87阅读模式
英文:

Cannot start debug in Gogland 1.0 EAP on macOS Sierra

问题

我最近切换到了Go语言。我选择了JetBrains Gogland作为IDE。我喜欢Go和IDE,除了一个问题。我不知道这是IDE的问题还是Go语言在macOS Sierra上的配置问题。但是当我尝试从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的信息:

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
英文:

I've switched to Go not so long ago. I've chosen JetBrains Gogland as IDE. I like both: Go and IDE, except a one issue. I don't know whether it is an issue with IDE or with Go lang configuration on macOS Sierra. But when I'm trying start debuging for a test from Gogland, the build fails with message:

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

I use 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"

Information about Gogland

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

答案1

得分: 0

你正在使用一个旧版本的IDE,请升级到最新版本,它将按预期工作。

供参考,这个问题在EAP 13 / 14中得到了解决(这是最新版本),请参考原始问题链接:https://youtrack.jetbrains.com/issue/GO-4430

英文:

You are using an old version of the IDE, please upgrade to the latest one and it will work as expected.

For reference, this issue was addressed in EAP 13 / 14 (which is the latest), see the original issue here: https://youtrack.jetbrains.com/issue/GO-4430

huangapple
  • 本文由 发表于 2017年9月19日 02:56:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/46286362.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定