proposal: Go 2: replace if and switch with when keyword #38280
Labels
FrozenDueToAge
LanguageChange
Proposal
Proposal-FinalCommentPeriod
v2
A language change or incompatible library change
Milestone
This can consider discussion, just sharing my idea, to replace 2 keywords we can attempt to address decade old problem:
if err != nil
andswitch x
:When there is something in
err
variable, it will fall under the same condition asdefault
case in switch/when statement. It should sound natural.case...when
statement.Expand the scope in place rather than replacing
if err != nil
withswitch
.The text was updated successfully, but these errors were encountered: