Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
gccgo: wrong PkgPath for embedded struct field in package main #10173
Comments
h4ck3rm1k3
commented
Mar 16, 2015
|
@ianlancetaylor you want a bugzilla for this? |
|
Just filing an issue here should be fine.
The underlying problem: https://play.golang.org/p/ByKziK5maw
gccgo returns "main" for the PkgPath, but gc correctly returns "" for
PkgPath.
|
minux
changed the title from
GCCGO encoding/xml problem with reflecting
to
gccgo: wrong PkgPath for embedded struct field in package main
Mar 16, 2015
h4ck3rm1k3
commented
Mar 16, 2015
|
I had already hacked that code to return "" and it causes a reflection error on the access of a private method later on. Using this version of encoding with all types of print statements added
|
|
Isn't this the same problem as #7247? |
|
Yes. |
minux
closed this
Mar 16, 2015
h4ck3rm1k3
commented
Mar 16, 2015
|
Even if you turn that flag off you will still get problems. Will have to research this more. |
gopherbot
locked and limited conversation to collaborators
Jun 25, 2016
gopherbot
added
the
FrozenDueToAge
label
Jun 25, 2016
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
h4ck3rm1k3 commentedMar 16, 2015
found this error porting https://github.com/metaleap/go-xsd to gcccode.
It seems that the reflection is failing here. The sub object is private but the field contained is public.
This is different in gccgo than go playground.
see https://play.golang.org/p/w_FzGI3LvW
Output with the playground
output with gcc-go-5
using gccgo-5 (Debian 5-20150226-1) 5.0.0 20150226 (experimental) [trunk revision 220999]