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
embed: document that paths must satisfy fs.ValidPath(name) #44012
Comments
I think that |
Note that the documentation for
|
The documentation for I think there is no need to mention that the path needs to be clean, because the documentation specifies exactly how a path should be. |
Change https://golang.org/cl/290071 mentions this issue: |
I've updated the docs to explain the restrictions on valid patterns. They're the same as Also clarified that leading and trailing slashes are disallowed in |
The embed documentation does not says that paths must also satisfy
fs.ValidPath(name)
. It only saysand
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
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.The text was updated successfully, but these errors were encountered: