IMO, the two mismatched length cases are the reason this doesn't fit
into Go. You gave suggestions for what the behavior would be (1. ditch
the extra values and 2. fill in 'nil' [note that this actually doesn't
work -- strings cannot be nil, for instance -- but we could use a zero
value for the type]). However, these sort of "make a best-effort guess
at what the programmer intended and keep trucking" semantics are not
really found in the language. Go wants you to be explicit about what
you intend.
It could work for arrays but their usage is relatively rare.
Note that you can always do
s := []string{"one", "two", "three"}
one, two, three := s[0], s[1], s[2]
-Caleb
> --
> You received this message because you are subscribed to the Google Groups
> "golang-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
golang-dev+...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.