Quantcast
Channel: Golang: Having trouble with nested JSON Unmarshaler - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Mediocre Gopher for Golang: Having trouble with nested JSON...

I figured this out.If you have the struct definition like this:type Wat struct { A, B string Somefin}Then the error I described in the OP happens. But if you do:type Wat struct { A, B string Somefin...

View Article



Answer by nemo for Golang: Having trouble with nested JSON Unmarshaler

Why you are getting no result at the endThis is no bug in the decoder, it is a bug in your code. You're just assigning another addressto the local pointer s in UnmarshalJSON. Corrected code:func (s...

View Article

Golang: Having trouble with nested JSON Unmarshaler

Given the following code:package mainimport ("encoding/json""log")type Somefin stringfunc (s *Somefin) UnmarshalJSON(b []byte) error { log.Println("Unmarshaling",string(b)) *s =...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images