(Pulling this specifically out of #377, the general := bug)
This proposal is about permitting a struct field (and other such l-values) on the left side of :=, as long as there's a new variable being created (the usual := rule).
That is, permit the t.i here:
func foo() {
var t struct { i int }
t.i, x := 1, 2
...
}
This should be backwards compatible with Go 1.
Edit: clarification: any l-value that = supports, not just struct fields.
/cc @griesemer @ianlancetaylor
(Pulling this specifically out of #377, the general
:=bug)This proposal is about permitting a struct field (and other such l-values) on the left side of
:=, as long as there's a new variable being created (the usual:=rule).That is, permit the
t.ihere:This should be backwards compatible with Go 1.
Edit: clarification: any l-value that
=supports, not just struct fields./cc @griesemer @ianlancetaylor