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 ArticleAnswer 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 ArticleGolang: 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
More Pages to Explore .....