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.
x/tools/cmd/gorename: keyword as identifier #16535
While refactoring some code written a bit too C-stylish with constants in uppercase I by mistake renamed a constant named SWITCH to switch. This particular operation was successful but the next rename failed.
I remember reading that gorename should take a well-typed program and either return an error or another well-typed program as its output. But in this case it broke the code for me by my own stupidity.
Would it be possible to have gorename check for reserved keywords before applying the requested changes?
Renaming the variable SWITCH to lowercase and then trying to rename it to something else.