defining a struct
type Name struct {
field type
a, b type
}instantiation
data := Name{field, a, b} // in order if names are excluded
data := Name{
feild: field,
a: a,
b: b,
}anon structure
var sample struct {
field type
a, b type
}
sample.field = "hello"
sample.a, sample.b = 1, 2
// or
sample := struct {
field type
a, b type
}{
field: "hello"
a: 1
b: 2
}