我是Go的新手.这个问题让我疯了.你如何在Go中初始化结构数组?
type opt struct {
shortnm char
longnm, help string
needArg bool
}
const basename_opts []opt {
opt {
shortnm: 'a',
longnm: "multiple",
needArg: false,
help: "Usage for a"}
},
opt {
shortnm: 'b',
longnm: "b-option",
needArg: false,
help: "Usage for b"}
}
Run Code Online (Sandbox Code Playgroud)
编译器说它期待';' 在[]选择之后.
我应该把大括号'{'放到init我的struct数组中?
谢谢