cmd/go: go:embed fails with special characters in module parent directory #53314
Labels
FrozenDueToAge
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have a simple file structure for a main package under a directory
foo
.go.mod
is just the model name and Go version.The
main.go
embedsbaz.txt
and prints its contents.baz.txt
contains a simple string,This works as expected.
If I change the parent directory of the module from
foo
to[foo]
,go build
cannot findbaz.txt
.What did you expect to see?
I expected the same behavior in both cases (
go build
succeeding).What did you see instead?
go build
cannot resolve the embed if a parent directory of the module contains square brackets. It doesn't seem like this should matter, since it is outside the module itself and is a valid directory name.The text was updated successfully, but these errors were encountered: