Thanks!. thats what I was looking for. I had tried using the assignment Dt.P = Pr before the unmarshalling of the JSON to the variable pdata and it would not work.
On Fri, Feb 3, 2017 at 5:18 PM, Konstantin Khomoutov < flatw...@users.sourceforge.net> wrote: > On Fri, 3 Feb 2017 03:32:00 -0800 (PST) > Rejoy <rejo...@gmail.com> wrote: > > > I am trying to pass a slice of data to a struct field . The field has > > a type of another struct. I get blank values in the output. > > > > Here is the code: https://play.golang.org/p/-YZ7UUI--D > > > > I 'd like to understand how to pass on the slice data to a struct > > field. > > It's not clear what do you want to achieve as the question mentions > slices, the code example deals with JSON unmarshaling and unrelated > value juggling. > > But is <https://play.golang.org/p/FxcA0vW9ZU> what you're after? > (See line 36 there.) > -- 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. For more options, visit https://groups.google.com/d/optout.