How to create array of objects in golang?

前端 未结 2 493
有刺的猬
有刺的猬 2021-02-04 08:31

I have a requirement in which I need to store array of objects in a variable. The objects are of different types. Refer to following example:

 v := [ {\"name\":\         


        
2条回答
  •  天命终不由人
    2021-02-04 09:17

    Perfect python syntax, but go unfortunately use something less readable. https://golang.org/ref/spec#Composite_literals

提交回复
热议问题