Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: multiline comment after switch expression causes build errors #33657
What version of Go are you using (
This is mostly working as intended, or at least working as specified. As the spec says, a multiline comment is replaced by a newline. Thus your code, as seen by the compiler, has a newline after the 1, which by the rules of semicolon insertion terminates the switch statement at that point.
The error messages are a little odd, but the program is not valid.