Open GoogleCodeExporter opened 9 years ago
We require a converter for any custom type.
Not sure if we should do type switching for derived basic types; I will take a
look at encoding/json, but for the type being, register a function:
decoder.RegisterConverter(Foo(0), func(s string) {
if v, err := strconv.ParseUint(s, 10, 0); err == nil {
return reflect.ValueOf(Foo(v))
}
return reflect.Value{}
})
Original comment by rodrigo.moraes
on 25 Apr 2012 at 7:24
Original issue reported on code.google.com by
n...@daaku.org
on 25 Apr 2012 at 12:15Attachments: