Please answer these questions before submitting your issue. Thanks!
What version of Go are you using ( go version
)?
go version go1.9 linux/amd64
Does this issue reproduce with the latest release?
Yes, fails with git tip
as well.
What operating system and processor architecture are you using ( go env
)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/travis/gopath"
GORACE=""
GOROOT="/home/travis/.gimme/versions/go1.9.linux.amd64"
GOTOOLDIR="/home/travis/.gimme/versions/go1.9.linux.amd64/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build036482233=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
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"
What did you do?
100% reproducible. Travis link:
https://travis-ci.org/purpleidea/mgmt/jobs/270103895#L969
(errors are on the subsequent lines)
What did you expect to see?
No failures or a clear reason about what's wrong.
What did you see instead?
gotype fails where it didn't fail in golang 1.8
it would be great to report this as a false positive or to understand what changed between 1.8 and 1.9 that this is an issue.
Thanks!
James
6条答案
按热度按时间gzszwxb41#
关于上游问题的顺便提一下:libvirt/libvirt-go#22
ia2d9nvy2#
@purpleidea,感谢你的报告!很遗憾Go1.9版本已经发布(如果能早点报告就好了),但如果在周期内容易修复的话,这可能是Go1.9.1的一个候选版本。另外,如果你能提取一个可复现的代码片段并粘贴在这里,它可能会有助于更轻松地诊断和修复问题。
/cc @griesemer。
oyjwcjzk3#
zlhcx6iw4#
1.9版本的主要变化是
gotype
现在使用了源导入器。您可以尝试使用标志-c=gc
运行gotype
,看看问题是否得到解决?92dk7w1h5#
这个示例在没有指定
-c=gc
的情况下会失败,并显示以下消息:s1ag04yj6#
这里使用go/types与cgo代码的问题。这些天它应该能正常工作吗?
我可以用
重现这个问题,其中foo.go是上面提到的文件。它会打印出
。常量都是用cgo代码定义的,如下所示: