IssueRaiser

proposal: spec: let := support any l-value that = supports

(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: ```go 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

Posted by bradfitz on Feb 19, 2019, 10:24 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,000 issues0 comments

support (Other)

proposal: spec: let := support any l-value that = supports

bradfitzFeb 19, 2019, 10:24 PM

(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: ```go 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

Comments (0)

No comments yet. Start the discussion.

Comment on this issue