-
Notifications
You must be signed in to change notification settings - Fork 26
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
column numbers and -apply don't always work with cgo #3
Comments
Quoting from golang.org/x/tools/go/loader:
Of course, I'm relying on I guess I need to switch to using ( |
Package loader parses the cgo-processed source, so offsets and column numbers don't match the original source. This commit changes the internal code to track the exploded token.Position values instead of raw integer offsets, so that unconvert can at least report line numbers of unnecessary conversions in cgo-using source files. Updates #3.
See @tamird's tests at #12 (comment) TL;DR: We really only have accurate line number info for cgo-processed files, not even column number. To implement it correctly, we'll need some sort of matching heuristic to correlate intraline position info between the cgo-using files before and after cgo processing. |
I think this could be fixed by having upstream use |
Looks like we'll have that in Go 1.12 actually: golang/go#26745. |
Confirmed that this will be fixed for Go 1.12, including support for -apply. |
The text was updated successfully, but these errors were encountered: