-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
LanguageChangeSuggested changes to the Go languageSuggested changes to the Go languageLanguageChangeReviewDiscussed by language change review committeeDiscussed by language change review committeeProposal
Milestone
Description
(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.
bcmills, networkimprov, urandom, bronze1man, kallydev and 86 moremiladrahimi, bogdanpetrea, scorsi and beoran
Metadata
Metadata
Assignees
Labels
LanguageChangeSuggested changes to the Go languageSuggested changes to the Go languageLanguageChangeReviewDiscussed by language change review committeeDiscussed by language change review committeeProposal