Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cmd/gofmt: rewrite 'a -> a' transforms 'default:' into 'case :' #33103
What version of Go are you using (
Thanks for the report.
I checked, this affects Go 1.12.7 as well as Go 1.10.5, so it's not a new regression in Go 1.13 beta 1.
Given this and the other 2 issues you reported (#33104, #33105), it seems there are some bugs in the rewrite rules when doing an identity replacement (
@rillig Have you seen this issue come up in more practical replace rules other than the no-op
I checked https://goissues.org/cmd/gofmt and it doesn't seem that this was reported in the past, so thanks again.
@dmitshur The reason I tried out the
To make sure that gofmt doesn't damage my code, my idea was to first try the transformation by essentially doing nothing, before actually transforming something. So instead of running
The simplest such call is