You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As one of the bigger users of the GOPACKAGESDRIVER protocol (with Bazel), we tend to not always follow the exact Go convention for the use of internal packages. Eg, an auto generated mock for package x/y/internal/z may be under mocks/x/y/internal/zmock, instead of just directly under x/y/internal/zmock. This causes the ValidImport check to fail.
What did you see happen?
When using the mocks/x/y/internal/zmock package under the x/y/internal/z tests, a warning shows up as follows:
could not import mocks/x/y/internal/zmock (invalid use of internal package "mocks/x/y/internal/zmock")compilerBrokenImport
What did you expect to see?
No warning for invalid use of internal, as these scoping warnings can be provided by Bazel directly through the Errors field in the gopackagesdriver protocol. The best way to achieve this may be a setting (eg invalidimport) under gopls.analyses that we can disable in our environment to suppress this error.
Editor and settings
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
JamyDev
added
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
labels
Apr 16, 2024
gopls version
go env
What did you do?
As one of the bigger users of the
GOPACKAGESDRIVER
protocol (with Bazel), we tend to not always follow the exact Go convention for the use of internal packages. Eg, an auto generated mock for packagex/y/internal/z
may be undermocks/x/y/internal/zmock
, instead of just directly underx/y/internal/zmock
. This causes the ValidImport check to fail.What did you see happen?
When using the
mocks/x/y/internal/zmock
package under thex/y/internal/z
tests, a warning shows up as follows:What did you expect to see?
No warning for invalid use of internal, as these scoping warnings can be provided by Bazel directly through the Errors field in the gopackagesdriver protocol. The best way to achieve this may be a setting (eg
invalidimport
) undergopls.analyses
that we can disable in our environment to suppress this error.Editor and settings
No response
Logs
No response
The text was updated successfully, but these errors were encountered: