NeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.
ysmolsky
changed the title
x/tools/cmd/gorename: panic while trying to rename to real
x/tools/cmd/gorename: renaming to keywords should result in "not a valid identifier" error
Nov 21, 2018
We can improve gorename by handling rename to builtins the same way as keywords are handled. It should return this error: gorename: -to "len": not a valid identifier
ysmolsky
changed the title
x/tools/cmd/gorename: renaming to keywords should result in "not a valid identifier" error
x/tools/cmd/gorename: renaming to builtins should result in "not a valid identifier" error
Nov 21, 2018
Renames to built-in names should not be handled specially. There are plenty of occasions when you want to re-use a predeclared name, such as a function called print or real, or a method called int or string.
The tool should not crash, of course.
ysmolsky
changed the title
x/tools/cmd/gorename: renaming to builtins should result in "not a valid identifier" error
x/tools/cmd/gorename: allow renaming to builtins
Nov 21, 2018
gopherbot
added
the
Tools
This label describes issues relating to any tools in the x/tools repository.
label
Sep 12, 2019
NeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.
6 participants
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.
What did you do?
While trying to rename a variable (func, etc..) to
real
the gorename tool panics.Suppose you have a
main.go
like this:And you run
gorename -from 'main.go::world' -to real
What did you expect to see?
Expected output:
Renamed 2 occurrences in 1 file in 1 package.
and the
main.go
file containing:What did you see instead?
System details
The text was updated successfully, but these errors were encountered: