Re: [go-nuts] Interface{} constrains on specific types

2016-06-24 Thread 'Thomas Bushnell, BSG' via golang-nuts
The trick is to do this: Decl special_interface and then special_interface requires an unexported interface which you implement in the specific (new) types that you can store in the thing. On Fri, Jun 24, 2016 at 3:10 PM 'Mihai B' via golang-nuts < golang-nuts@googlegroups.com> wrote: > I'm

[go-nuts] Interface{} constrains on specific types

2016-06-24 Thread 'Mihai B' via golang-nuts
I'm developing a json schema generator (json schema from Go ast and the other way around). There is a keyword "oneOf" which requires exactly one schema to be valid in this keyword's value. In Go I translate it by using an empty interface{}. The issue is that when I convert the interface{} to