Thank you, I was suspecting that it was something simple I was missing.
On 2020-07-29, 3:47 PM, "burak serdar" <[email protected]> wrote:
On Wed, Jul 29, 2020 at 1:42 PM sbezverk <[email protected]> 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 [email protected].
> 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/C7CBE68B-063C-405B-AD0C-750A6708F2F5%40gmail.com.