ohler55 / ojg

Optimized JSON for Go
MIT License
839 stars 50 forks source link

oj.Unmarshal doesn't use custom unmarshalers #73

Closed right-mouse closed 3 years ago

right-mouse commented 3 years ago

oj.Unmarshal doesn't seem to use custom unmarshaling rules defined by implementing the json.Unmarshaler interface.

Simple playground example: https://play.golang.org/p/-cbMOSel_C6

ohler55 commented 3 years ago

v1.12.6 released with the fix.

right-mouse commented 3 years ago

Seems to work when Unmarshal is called on the json.Unmarshaler directly, but it doesn't work if the json.Unmarshaler is part of a struct. Updated playground example: https://play.golang.org/p/CygEQ9xDR2I

ohler55 commented 3 years ago

Please try the '32-bit' branch.

right-mouse commented 3 years ago

Works now. Thanks for the fix.

ohler55 commented 3 years ago

Thanks. I'll release when the 32bit fixes are verified.