-
-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Description
Before:
switch x {
case
longConstantName1,
longConstantName2:
// A comment.
fmt.Println(x)
case
longConstantName3,
longConstantName4:
// Do nothing.
default:
// Another comment.
fmt.Println(x * 2)
}After:
switch x {
case
longConstantName1,
longConstantName2:
// A comment.
fmt.Println(x)
case longConstantName3, longConstantName4:
// Do nothing.
default:
// Another comment.
fmt.Println(x * 2)
}Notice how the first case remains multiline (the desired behaviour) while the second case is put onto a single line (not the desired behaviour). The only reason between the two seems to be that the first case has code in it while the second doesn't.
gofumpt --versionv0.3.2-0.20220322194931-6b144e85e83b
Full code: https://go.dev/play/p/cCkatTotVs_L.
I'm ready to provide additional data if that helps.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels