K
K
Kostyan Kondr2017-02-21 14:10:33
go
Kostyan Kondr, 2017-02-21 14:10:33

How to copy structure in golang?

I'm trying to copy the structure and marshal json into it
, here's a link to the playground
and something doesn't fit with me. How to do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita, 2017-02-21
@bitver

//18: 
err := json.Unmarshal(eee, k)

Here you create a map[string]interface{} and assign its pointer to the *k* interface. Those. Roughly speaking, you simply overwrite the variable and everything that is written above is meaningless.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question