We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It executes before the switch expression is evaluated, if any:
switch g := employee.Attributes.Gender; g { case person.GenderFemale, person.GenderMale, person.GenderOther: return g } switch a := employee.Attributes { case a.IsActive, a.OnVacation, a.OnMaternityLeave: return a.Name }
Same reasoning as having an optional simple statement in the if statement.
I suspect this will be denied, even for Go 2, but I didn't see any other issues about it, and I'm curious what the reasoning was for not having it.
The text was updated successfully, but these errors were encountered:
Perhaps I'm missing something, but this already exists: https://golang.org/ref/spec#ExprSwitchStmt
Sorry, something went wrong.
Ugh, I could have sworn I saw a compiler error about it, and I was right there in the spec too. Please ignore, I'm dumb.
No branches or pull requests
It executes before the switch expression is evaluated, if any:
Same reasoning as having an optional simple statement in the if statement.
I suspect this will be denied, even for Go 2, but I didn't see any other issues about it, and I'm curious what the reasoning was for not having it.
The text was updated successfully, but these errors were encountered: