New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go/types: doesn't understands constants defined in cgo code #21712
Comments
Upstream issue btw: libvirt/libvirt-go#22 |
@purpleidea, thanks for the report! Unfortunately the Go1.9 ship has sailed(it would have been nice to report this earlier) but perhaps this could be a candidate for Go1.9.1 if easily fixable within the cycle. Also it might help with easier diagnosis and fixing if you could extract a reproducible code snippet then paste it here. /cc @griesemer. |
It's 100% easy to reproduce, just run gotype on the libvirt package :)
As seen in my travis example.
as for 1.9.1 that would be fine, good idea!
…On Thu, Aug 31, 2017 at 3:50 AM, Emmanuel T Odeke ***@***.***> wrote:
@purpleidea <https://github.com/purpleidea>, thanks for the report!
Unfortunately the Go1.9 ship has sailed(it would have been nice to report
this earlier) but perhaps this could be a candidate for Go1.9.1 if easily
fixable within the cycle. Also it might help with easier diagnosis and
fixing if you could extract a reproducible code snippet then paste it here.
/cc @griesemer <https://github.com/griesemer>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21712 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAIPsyVmxBz7vXtlc5d0XohnoNkCboGEks5sdmXSgaJpZM4PIVh->
.
|
The major thing that changed for 1.9 is that |
This example fails the check unless package main
import "github.com/veandco/go-sdl2/sdl"
func main() {
sdl.PeepEvents(nil, sdl.GETEVENT, sdl.FIRSTEVENT, sdl.LASTEVENT)
} with the message
|
The problem here is using go/types with cgo code. Is that supposed to work these days? I can recreate the problem with
where foo.go is the file mentioned above. That prints
The constants are all defined with cgo code like: const (
GETEVENT = C.SDL_GETEVENT
) |
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
)?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
The text was updated successfully, but these errors were encountered: