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

Open
josharian opened this issue Apr 10, 2017 · 2 comments

Comments

@josharian
Copy link
Contributor

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

@josharian

This comment has been minimized.

Copy link
Contributor Author

commented Apr 10, 2017

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

@gopherbot

This comment has been minimized.

Copy link

commented Apr 10, 2017

CL https://golang.org/cl/40171 mentions this issue.

gopherbot pushed a commit to golang/tools that referenced this issue May 10, 2017
refactor/rename: add line number to ambiguityError
Updates golang/go#19906

Change-Id: If13c828541cdb3937e5e970dd8add7615d36d866
Reviewed-on: https://go-review.googlesource.com/40171
Reviewed-by: David R. Jenni <david.r.jenni@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>

@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
Projects
None yet
2 participants
You can’t perform that action at this time.