Re:OAuth 3
by alyandon on Thursday October 22, 2020 @10:02AM
(#24858118)
Lovely - I can't wait to see how horrible something like that is to implement in a language like Go.
[ Parent
| on HN ]
Re:OAuth 3
by dullgiulio on Thursday October 22, 2020 @01:01PM
(#24860266)
You have to implement UnmarshalJSON. Between each attempt to deserialize into a possible struct, be careful to return on errors that are not JSON serialisation errors (for example caused by reading from the underlying Reader, etc.)
It's ugly and verbose but there is no need to use empty interface.
Re:OAuth 3
by CameronNemo on Thursday October 22, 2020 @11:57AM
(#24859394)
Sounds like a golang problem. Rust can easily handle it with union types from what I have seen.
I hope you enjoy working with interface{}
_sigh_
Re:OAuth 3
by nullandvoid on Thursday October 22, 2020 @10:17AM
(#24858268)
interface{} to the rescue