鉴于以下情况:
var positionTitles []string
var positionRelationships []string
var positionInstitutions []string
positionTitles = ["Director" "Provost" "Assistant Provost"]
positionRelationships = ["Tenured Professor" "Lecturer" "Adjunct Professor"]
positionInstitutions = ["UCSC" "UCB" "USC"]
我将如何构造一个看起来像这样的数组:
Positions :=
[{
PositionTitle: "Director",
PositionRelationships: "Tenured Professor",
PositionInstitution: "UCSC",
},
{
PositionTitle: "Provost",
PositionRelationships: "Lecturer",
PositionInstitution: "UCB",
},
{
PositionTitle: "Assistant Provost",
PositionRelationships: "Adjunct Professor",
PositionInstitution: "USC",
}]
目标是迭代位置。
去游乐场我已经开始了:http : //play.golang.org/p/za_9U7eHHT
噜噜哒
DIEA
相关分类