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
cmd/go: mod vendor
tries to evaluate go:embed pattern inside _test.go files
#63473
Milestone
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, I misremembered. cc @bcmills |
seankhliao
added
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
GoCommand
cmd/go
labels
Oct 9, 2023
So, according to the
We should not include embed patterns in test files when vendoring? cc @matloob |
quantonganh
added a commit
to quantonganh/go
that referenced
this issue
Oct 11, 2023
Currently, `go mod vendor` copy all files matched by //go:embed, even when it is in a _test.go file. According to the documentation, it should not include test code for vendored packages. Fixes golang#63473
Change https://go.dev/cl/534495 mentions this issue: |
Change https://go.dev/cl/534376 mentions this issue: |
bcmills
added
the
NeedsFix
The path to resolution is known, but the work has not been done.
label
Oct 13, 2023
gopherbot
removed
the
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
label
Oct 13, 2023
yunginnanet
pushed a commit
to yunginnanet/go
that referenced
this issue
Oct 20, 2023
Currently, go mod vendor copy all files matched by //go:embed, even when it is in a _test.go file. According to the documentation, it should not include test code for vendored packages. Fixes golang#63473 Change-Id: I28c411724fc7b7aeb683857fc114e20b08635e01 Reviewed-on: https://go-review.googlesource.com/c/go/+/534376 Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I don't know.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go:embed
directives inside a_test.go
file.For example, https://github.com/emiago/sipgo/blob/main/server_integration_test.go#L26 contains
go:embed
directives that will not satisfied.go mod vendor
:What did you expect to see?
go mod vendor
completes normallyWhat did you see instead?
The text was updated successfully, but these errors were encountered: