Skip to content
New issue

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

x/tools/refactor/rename: bad positions in "ambiguous specifier" error message #19906

josharian opened this issue Apr 10, 2017 · 2 comments


Copy link

@josharian josharian commented Apr 10, 2017

In directory $GOROOT/src:

$ gorename -from \"cmd/internal/obj/arm64\"::c -to ___ -d
gorename: ambiguous specifier c matches var at asm7.go:6, var at asm7.go:6, var at asm7.go:2, var at asm7.go:5, var at asm7.go:43, var at asm7.go:2

The positions here are bogus; there is no object c at any of these places. These appear to be line offsets relative to functions containing local variables called c.

There's also an implicit feature request here. I'm running this command to find all the local variables named c. Then I will inspect them, pick a good new name for them, and gorename them one at a time. The -to=___ is just because a -to is required, and -d is to avoid actually changing the files; I don't really want any of that, I just want to know where the c's are. Maybe there's a better way? Perhaps a gorename flag that just tells you the declaration site of all impacted objects?

cc @alandonovan

@josharian josharian added this to the Unreleased milestone Apr 10, 2017
Copy link
Contributor Author

@josharian josharian commented Apr 10, 2017

Ah, nope, they're column numbers. Fix for the error message coming soon.

Copy link

@gopherbot gopherbot commented Apr 10, 2017

CL mentions this issue.

gopherbot pushed a commit to golang/tools that referenced this issue May 10, 2017
Updates golang/go#19906

Change-Id: If13c828541cdb3937e5e970dd8add7615d36d866
Reviewed-by: David R. Jenni <>
Reviewed-by: Robert Griesemer <>
Reviewed-by: Alan Donovan <>
@gopherbot gopherbot added the Tools label Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants