No, whoever designed the schema of this API has lost their marbles,
(or lacks any kind of consideration for the unfortunate souls who need to 
use this API).

Unmarshalling a value whose type is not fixed is a pain in Go.
But handling a value of unknown type will be a headache in any language.



On Wednesday, 2 June 2021 at 19:55:40 UTC+1 rob...@glonek.co.uk wrote:

> I think I'm loosing my marbles. Nevermind what I said.
>
> On Wednesday, 2 June 2021 at 16:22:34 UTC+1 Brian Candler wrote:
>
>> > If you try using switch value.(type) instead of using reflect, bool 
>> will be reported as int, fyi, so using reflect here.
>>
>> Could you explain that a bit further please?  A type switch seems to work 
>> OK for me, with no reflect.
>> https://play.golang.org/p/TBH5zKYnG4G
>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/3b039ea4-7c16-4472-9bfc-4a626bf82478n%40googlegroups.com.

Reply via email to