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: warn about dotfiles in embed.FS documentation #42321
Comments
This is not a "documentation", but design issue, so this won't solve... anything? |
I think documenting that dotfiles are included will solve 90% of this issue: it can be a surprising behavior. For the final 10%, I think there should be a way of excluding files, but I need to open another issue for that. |
I think this speaks to a potential problem where the embedded data could differ between using someone else's module with embedded data (determined by whatever git/module serving rules dictate those contents) and checking code out locally to use it. I'm also wondering if this means that a build can differ depending on whether or not GOPROXY was used, since now more than just the .go/.s/.c/.h files matter as they are laid out on disk. |
I would actually like the ability of exluding specific files. even if we document dot file inclusion it would be good to have a way to ecxlude them, same as excluding something like |
I tentatively disagree. It seems to me that if you wanted to exclude certain files you shouldn't have selected those files in the first place using the glob. I suspect allowing excluding individual files will end up with projects having giant lists of temp files to be excluded, one person excludes the |
This issue can be the proposal for documentation, and #42325 can be a proposal for excluding files. |
I worry that attempting to split this up into many disparate specific proposals will cloud discussion trying to better understand implications and solutions to the various types of "unintended" files appearing in embedded filesystems. |
/cc @rsc |
We should certainly document for now that dot-files are included in a match of star. |
Fixed in embed docs:
|
What version of Go are you using (
go version
)?Tip.
Does this issue reproduce with the latest release?
Yes.
What did you do?
Tried out the new embed.FS feature.
example.go:
example:
What did you expect to see?
What did you see instead?
There should be a warning in the documentation that dotfiles and hidden files are included.
The text was updated successfully, but these errors were encountered: