-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
FrozenDueToAgeLanguageChangeSuggested changes to the Go languageSuggested changes to the Go languageProposalv2An incompatible library changeAn incompatible library change
Milestone
Description
Is there any good reason for this to be unsupported:
x.f, err := f()
This would be unambiguous, as it would only work if x was previously declared and err
was not.
The fact it doesn't work forces the use of:
var err error
x.f, err = f()
Which while okay, doesn't feel like an improvement over the former version.
As is known, there's also precedence for the use of := on reassignments, given that the
statement:
x, err := f()
may reassign x if it was already declared in the current scope.gbl08ma, gkop, DeedleFake, sgolemon, AlekSi and 3 more
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeLanguageChangeSuggested changes to the Go languageSuggested changes to the Go languageProposalv2An incompatible library changeAn incompatible library change