-
Notifications
You must be signed in to change notification settings - Fork 18k
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/gopls: build mod diagnostics with GOWORK=off #50862
Comments
That error message looks deeply wrong to me. |
(That is: I agree that there is at least one bug here, but it may be more fundamental than workspace mode. 😅) |
Some more interesting behavior! For some reason
|
Change https://go.dev/cl/405259 mentions this issue: |
@bcmills @matloob is it valid to depend on this behavior from i.e. this result:
It works, and solves our problem, but feel rather incorrect. |
Hmm. In general if we can't determine the import path(s) for a pattern we should report an error for that pattern, so that should be safe to rely on. I agree that it feels a bit iffy, but I think the only better alternative might be to omit the |
gopls relies on errors produced by the go command to suggest fixes to our users, but when using go.work, we don't get all of these errors. We can work around this by running
go
commands with-workfile=off
to build our diagnostics.Example (based on
gopls/internal/regtest/workspace.TestUseGoWork
):CC @matloob
The text was updated successfully, but these errors were encountered: