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
go version
$ go version go version go1.17 linux/amd64
I pass this file to gofmt:
package main import "fmt" import "math/rand" func main() { r := rand.Intn(5) switch r { case 0: fmt.Println("It's zero!") case 1, 2: fmt.Println("It's one or two!") default: fmt.Println("It's something else") } }
Notice how the case list of case 1,2 blends into the case's code.
case 1,2
I can think of two options:
The text was updated successfully, but these errors were encountered:
I don't know the logic of gofmt. This might be the same issue as #48064. Sorry to double submit if this is the case.
Sorry, something went wrong.
No worries. It indeed looks like a dup. Closing.
No branches or pull requests
What version of Go are you using (
go version
)?What did you do?
I pass this file to gofmt:
What did you see?
Notice how the case list of
case 1,2
blends into the case's code.What did you expect?
I can think of two options:
The text was updated successfully, but these errors were encountered: