Is there a built in function in go for making copies of arbitrary maps?

后端 未结 4 2022
心在旅途
心在旅途 2021-01-04 04:19

Is there a built in function in go for making copies of arbitrary maps?

I would be able to write one by hand but I found out earlier I was looking a similar question

4条回答
  •  佛祖请我去吃肉
    2021-01-04 04:39

    To add to the answer by Simpfally, some gotchas with encoding/gob are that with structs, only exported fields are copied. And channels can't be encoded.

提交回复
热议问题