douyao1856 2018-11-18 12:56
浏览 48

类型foo struct和类型foo [] struct的区别

What is the main difference between these structs?

type foo struct {
    Name string `json:"name"`
}

and

type foo []struct {
    Name string `json:"name"`
}
  • 写回答

1条回答 默认 最新

  • du9698 2018-11-18 13:32
    关注
    type foo1 struct {
        Name string `json:"name"`
    }
    
    type foo2 []struct {
        Name string `json:"name"`
    }
    

    Simple understand as

    type foo2 []foo1 
    
    评论

报告相同问题?