Re: [go-nuts] Breaking change: reflect.StructOf: field 0 has no name
On Mon, Dec 11, 2017 at 11:23 AM,wrote: > Is there any reason why this breaking change is not mentioned in any of the > release notes? The original code did not document how to create embedded fields, and the support that it did have did not work correctly (it did not set the package path correctly). So I think we just assumed that we were only breaking people who were relying on undocumented and incorrect behavior, and therefore nothing special needed to be said in the release notes. Sorry for the trouble. See https://golang.org/issue/18780. Ian > On Monday, December 11, 2017 at 8:22:28 AM UTC+2, Ian Lance Taylor wrote: >> >> On Sun, Dec 10, 2017 at 8:46 AM, wrote: >> > >> > I had some code that I didn't touch for a while and now it seems it's >> > broken. It panics with `reflect.StructOf: field 0 has no name` at >> > runtime. >> > Wasn't Go supposed to have some sort of compatibility promise? >> > >> > After a while I've found this[1] issue which seems to be the reason why >> > my >> > program panics now and my question is why is a struct field without a >> > name >> > invalid ? Anonymous fields are supposed to have no field names, right? >> > >> > https://github.com/golang/go/issues/20600 >> >> Yes, unfortunately we had to change the way that it worked. To make >> an anonymous field, set the name to the type name and set Anonymous to >> true. >> >> Ian > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] Breaking change: reflect.StructOf: field 0 has no name
Is there any reason why this breaking change is not mentioned in any of the release notes? On Monday, December 11, 2017 at 8:22:28 AM UTC+2, Ian Lance Taylor wrote: > > On Sun, Dec 10, 2017 at 8:46 AM,wrote: > > > > I had some code that I didn't touch for a while and now it seems it's > > broken. It panics with `reflect.StructOf: field 0 has no name` at > runtime. > > Wasn't Go supposed to have some sort of compatibility promise? > > > > After a while I've found this[1] issue which seems to be the reason why > my > > program panics now and my question is why is a struct field without a > name > > invalid ? Anonymous fields are supposed to have no field names, right? > > > > https://github.com/golang/go/issues/20600 > > Yes, unfortunately we had to change the way that it worked. To make > an anonymous field, set the name to the type name and set Anonymous to > true. > > Ian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] Breaking change: reflect.StructOf: field 0 has no name
On Sun, Dec 10, 2017 at 8:46 AM,wrote: > > I had some code that I didn't touch for a while and now it seems it's > broken. It panics with `reflect.StructOf: field 0 has no name` at runtime. > Wasn't Go supposed to have some sort of compatibility promise? > > After a while I've found this[1] issue which seems to be the reason why my > program panics now and my question is why is a struct field without a name > invalid ? Anonymous fields are supposed to have no field names, right? > > https://github.com/golang/go/issues/20600 Yes, unfortunately we had to change the way that it worked. To make an anonymous field, set the name to the type name and set Anonymous to true. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[go-nuts] Breaking change: reflect.StructOf: field 0 has no name
I had some code that I didn't touch for a while and now it seems it's broken. It panics with `reflect.StructOf: field 0 has no name` at runtime. Wasn't Go supposed to have some sort of compatibility promise? After a while I've found this[1] issue which seems to be the reason why my program panics now and my question is why is a struct field without a name invalid ? Anonymous fields are supposed to have no field names, right? https://github.com/golang/go/issues/20600 Mihai. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.