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
When working with the //go:embed, I ran into an issue where it performed differently when working locally with go.work vs pulling the module using go get.
I have created a reproduction of the issue using a couple of modules:
For context, the embedvendor is representing a server that we created for tests that acts like it is accessing a VCS server. We utilize this across other modules. There are no go files in the vendor directories.
What did you see happen?
I have the getvendor module that depends on embedvendor. Everything works as expected when working with go.work accessing it from my local development environment. However, when I use go get to pull the module, the embed.FS within embedvendor is missing entire paths that include **/vendor/** in it.
I set up a test in embedvendor/fs_test.go to validate the entire embed.FS is available. It passes as expected.
However, inside getvendor/fs_test.go, I get a failure indicating the paths with vendor/ in it are missing.
If you add the go.work into the getvendor module and wire in the embedvendor from your filesystem, the tests pass. This disagreement was jarring and took a good while to determine.
What did you expect to see?
I expected the getvendor to have access to the entire embed.FS.
The text was updated successfully, but these errors were encountered:
Go version
go version go1.24.0 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
When working with the //go:embed, I ran into an issue where it performed differently when working locally with go.work vs pulling the module using go get.
I have created a reproduction of the issue using a couple of modules:
For context, the embedvendor is representing a server that we created for tests that acts like it is accessing a VCS server. We utilize this across other modules. There are no
go
files in thevendor
directories.What did you see happen?
I have the getvendor module that depends on embedvendor. Everything works as expected when working with go.work accessing it from my local development environment. However, when I use
go get
to pull the module, the embed.FS within embedvendor is missing entire paths that include**/vendor/**
in it.I set up a test in embedvendor/fs_test.go to validate the entire embed.FS is available. It passes as expected.
However, inside getvendor/fs_test.go, I get a failure indicating the paths with
vendor/
in it are missing.If you add the
go.work
into thegetvendor
module and wire in theembedvendor
from your filesystem, the tests pass. This disagreement was jarring and took a good while to determine.What did you expect to see?
I expected the
getvendor
to have access to the entireembed.FS
.The text was updated successfully, but these errors were encountered: