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: scans entire workspace when renaming internal symbol #12439

osocurioso opened this issue Sep 1, 2015 · 1 comment


Copy link

When renaming a symbol in an internal package, gorename finds and reports buggy packages outside the internal tree:

$ gorename -dryrun -from '"cmd/compile/internal/gc".Node' -to Qux
While scanning Go workspace:
Package "": found packages draw2d (arc.go) and curve (cubic_float64.go) in /gopath/src/
Package "": found packages glfw (glfw.go) and main (main.go) in /gopath/src/

Scanning the entire workspace seems unnecessary in this case, since symbols in internal packages cannot be imported outside the internal tree.

go version:

go version devel +e92d0d8 Tue Sep 1 16:28:49 2015 +0000 linux/amd64
Copy link

Because of Go's embedding mechanism, renaming symbols within internal packages can have effects that are visible to packages outside the "internal" subtree. So, this counterintuitive scan is required.

The oracle does need to be made more robust when scanning the entire workspace, though.

@golang golang locked and limited conversation to collaborators Feb 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

4 participants