It ends up being verbose and repetitive.
var foo = Foo{1, []struct{c, d int}{
struct{c, d int}{2, 3},
struct{c, d int}{4, 6},
}}
In this case, I'd say it's better just to name the struct.
- Evan
There was a long thread about composite literal notation
in the last few weeks. I suggest finding it and reading it.
Rob made the point that things that make sense in
tiny gems may not make sense at scale for very large
programs. It remains to be seen if this specific case
is one of them, but it was part of the discussion.
Russ
This is the thread and relevant post:
http://groups.google.com/group/golang-nuts/t/b38091463e9fea6c/170b1242cbc6e18c#170b1242cbc6e18c
Andrew