-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
The embed documentation does not says that paths must also satisfy fs.ValidPath(name)
. It only says
The path separator is a forward slash, even on Windows systems.
and
Patterns must not contain ‘.’ or ‘..’ path elements nor begin with a leading slash.
For example in this case:
//go:embed data/
the compiler fails with the error:
pattern data/: invalid pattern syntax
but "data/" is valid as pattern, it is not valid for the fs.ValidPath
function.
I think that the sentence
A //go:embed directive above a variable declaration specifies which files to embed, using one or more path.Match patterns.
should mention fs.ValidPath
and consequently "The path separator is a forward slash, even on Windows systems" and "Patterns must not contain ‘.’ or ‘..’ path elements nor begin with a leading slash" can be removed.