package main
type Foo struct {
A []string
B []string
}
func moo(f ...Foo) {
}
func main() {
// ideally: moo({A: {"1","2"}}, {B: {"x","y"}})
moo(Foo{A: []string{"1","2"}}, Foo{B: []string{"x","y"}})
}
package main
var m map[string]bool
func main() {
// why not: m = {} ?
m = map[string]bool{}
}
"We aren't allowing struct literals to elide the types, at least not yet, because elision can cause subtle bugs as programs evolve. Unlike in a slice, the fields of a struct can be rearranged, and the types provide more information about correctness than the values themselves. Such rearrangement could introduce subtle bugs that would be hard to discover, especially in a large program. Thus the elision is not permitted for structs at the moment." -rob
https://groups.google.com/d/msg/golang-nuts/6jJButs4ivQ/nfcg8vmaM0wJ