Previously, statements such as:
type T struct { a, b int }
[...]
x = T{}
x = T{b: 1}
would only affect the aggregate members mentioned in the composite
literal and leave the other members unchanged. This change causes us
to write a zero value to the target in cases where the target is not
already known to hold a zero value and the number of initializers in
the composite literal differs from the number of elements in its type.
Author: Peter Collingbourne. (hg clpatch got confused)
LGTM=pcc
R=pcc
CC=golang-codereviews
https://golang.org/cl/107980045
|
||
|---|---|---|
| .. | ||
| testdata | ||
| external.go | ||
| external_darwin.go | ||
| external_freebsd.go | ||
| external_plan9.go | ||
| external_unix.go | ||
| external_windows.go | ||
| interp.go | ||
| interp_test.go | ||
| map.go | ||
| ops.go | ||
| reflect.go | ||
| value.go | ||