-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/go/packages: report ImportStack for import cycles #35964
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
When go/packages detects an import cycle, it says that the packages.ErrorKind is a UnknownError not a ListError as defined on line 38 of internal/lsp/cache/errors.go |
Change https://golang.org/cl/210942 mentions this issue: |
This for the most part got handled in commit/0d08730. The packages.ErrorKind is still an UnknownError as opposed to a ListError. |
@ridersofrohan: It should be a one-line fix to a kind of List on line 818 of |
After the addition of golang/go#35964, the import cycle error now has the import stack attached in the message. This CL parses that stack and attached the import cycle diagnostic to the import versus just adding it to the first character of the .go file. Fixes golang/go#33085 Change-Id: I6f5f067c338879b898829951236f816aa63d9dfa Reviewed-on: https://go-review.googlesource.com/c/tools/+/210942 Run-TryBot: Rohan Challa <rohan@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Change https://golang.org/cl/212138 mentions this issue: |
When
go list
detects an import cycle, it reports the following error message:go/packages does not propagate the
ImportStack
, so it's not possible to determine the position in the file that the offending import corresponds to. Ideally, go/packages would propagate the ImportStack in the error, which would allowgopls
to extract a position for this error message. Even more ideally,go list
should report a position. 😄/cc @ridersofrohan @matloob @jayconrod
The text was updated successfully, but these errors were encountered: