-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile/internal/types2: inconsistent source paths printed in error message #68292
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
Comments
Related Issues (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
Change https://go.dev/cl/603097 mentions this issue: |
Thank you for the report. What is happening is that
cmd/go rewrites the output of gc in Shell.reportCmd. Excerpt from internal documentation:
When this happens is decided by replacePrefix. Docs:
This manifests as rewriting the output I think we should be consistent with the output here and have a relative path in both locations, e.g. |
@timothy-king I was wondering why play.go.dev didn't exhibit the same. Thanks for the writeup. |
Cf. #68737 |
Go version
go version go1.22.3 linux/amd64
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
In its error message, the compiler leaks the absolute path of "./leaks.go".
What did you expect to see?
I would have expected the error's source's source path to be presented relative to the current working directory (or relative to the current module's root). Such is the case on the playground: https://go.dev/play/p/890kN4mzITD
The text was updated successfully, but these errors were encountered: