jjzjj

StructureName

全部标签

arrays - (整数)作为结构数组的 slice 索引

在Go中是否可以创建数组,其中数组的每个元素都是slice数组或结构数组。类似于PHP$a=[1=>"test",2=>""]//inthisexample2isintegerwillbeforGoLang?$a[2]=[object,object,object]我可以在Go中做类似的事情吗?我知道不正确的语法。vara[int][]StructureNameb:=make([]StructureName,0)b:=append(b,StructureName{a,b,c,d})b:=append(b,StructureName{e,f,g,h})a[0]=append(a[0][0]