On Wed, Jul 29, 2020 at 1:42 PM sbezverk <sbezv...@gmail.com> wrote:
>
> Hello,
>
>
>
> A bit of help would be much appreciated, here is the sample code: 
> https://play.golang.org/p/FYEC7MwU1qQ
>
>
>
> I need to Unmarshal 3 levels map. The information is stored this was as a 
> json doc and there is no way to flatten it.  This sample code works but since 
> UnmarshalJSON method of Level1 type is not pointer receiver, I do not get 
> back into the main newly built map. If I change Level1’s UnmarshalJSON to a 
> pointer receiver then line 63 generates a syntax error “invalid operation: 
> cannot index l1 (variable of type *Level1)”

I can't say I understand what's really going on here, but if your
problem is with UnmarshalJSON receiver, then:

https://play.golang.org/p/Fl5XRO1ngXE


>
>
>
> I would greatly appreciate some suggestions how to solve this problem.
>
>
>
> Thank you
>
> Serguei
>
>
>
>
>
> --
> 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/214131C2-468E-4036-8F0D-B09037A57C55%40gmail.com.

-- 
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/CAMV2Rqp-H0NnkjoQfRCDATGbT7%3DxUCbHQcdrGACEWoRDd_hCVQ%40mail.gmail.com.

Reply via email to