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
a directory containing foo.go, foo_test.go and foo_test_external.go, where the first two of those declare package foo while the last has package foo_test,
a gazelle-generated BUILD file for those files, which defines the expected go_library and a go_test targets, for foo.go and the two _test.go files, respectively,
a bin/gopackagesdriver.sh, script which is a thin launcher for @io_bazel_rules_go//go/tools/gopackagesdriver ,
a VSCode settings file pointing GOPACKAGESDRIVER at said launcher,
... and of course a basic WORKSPACE file to set up latest rules_go and gazelle.
I then launched VSCode in this repo.
What did you expect to see?
bazel-powered gopls providing highlighting and analysis, including in foo_external_test.go.
What did you see instead?
package foo_test; expected foo (MismatchedPkgName) on line 1 of foo_external_test.go
The text was updated successfully, but these errors were encountered:
dt
changed the title
MismatchedPkgName with external test package
MismatchedPkgName with external test package and GOPACKAGESDRIVER
Aug 18, 2022
This looks very similar to the closed issue #3015, but that was marked as fixed by @illicitonion and @linzhp in #3116, which is in v0.34.0, which is what I am using in my reproduction repo above, so maybe this one is distinct?
Yep, I can confirm that in the minimal reproduction repro I linked in the issue, if I bump rules_go to use git_repository and commit 37ba8d5, the error no longer reproduces. Thanks so much for fixing this!
What version of rules_go are you using?
v0.34.0
What version of gazelle are you using?
v0.26.0
What version of Bazel are you using?
5.2.0
Does this issue reproduce with the latest releases of all the above?
These are the latest.
What operating system and processor architecture are you using?
macOS 12.5 Arm M1 Pro
Any other potentially useful information about your toolchain?
n/a
What did you do?
I have a ready-to-run minimal reproduction at https://github.com/dt/externdemo, but essentially it is:
foo.go
,foo_test.go
andfoo_test_external.go
, where the first two of those declarepackage foo
while the last haspackage foo_test
,go_library
and ago_test
targets, forfoo.go
and the two_test.go
files, respectively,bin/gopackagesdriver.sh
, script which is a thin launcher for@io_bazel_rules_go//go/tools/gopackagesdriver
,GOPACKAGESDRIVER
at said launcher,I then launched VSCode in this repo.
What did you expect to see?
bazel-powered gopls providing highlighting and analysis, including in foo_external_test.go.
What did you see instead?
package foo_test; expected foo (MismatchedPkgName)
on line 1 of foo_external_test.goThe text was updated successfully, but these errors were encountered: