I'm newbie in Go. This issue is driving me nuts. How do you init array of structs in 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"}
}
The compiler said it expecting ;
after []opt
.
Where should I put the braces {
to init my array of struct?