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
I read the docs for CreateFromDir, then used it in the most natural way I could think of by pointing it at a checked out repository I had on disk. It created a module zip file without errors. Since my goal was to ensure its output was identical to an algorithm I wrote previously, I noticed the zip was very large. It turned to be due to the ".git" directory being included, which wasn't my intention. I hope that "tools that build zip files" don't miss this.
I (probably) wouldn't have made the mistake of including .git directory if I used Create, because that requires an explicit list of files, and it's more clear all listed files are to be included/processed. However, it wasn't as clear when pointing to an existing directory on disk, given that CreateFromDir felt like a "high level" convenience wrapper.
I don't think there's any scenario where a .git directory should be included in a module zip file. CreateFromDir is indeed intended to be a convenience function, and including these directories significantly diminishes its value. We should exclude these, along with other VCS directory names.
The text was updated successfully, but these errors were encountered:
We should exclude these, along with other VCS directory names.
One of the major use-cases for CreateFromDir is to support VCS systems otherwise unknown to the go command. Would it make sense for CreateFromDir to ignore, say, all top-level directories whose paths start with a leading dot?
Would it make sense for CreateFromDir to ignore, say, all top-level directories whose paths start with a leading dot?
I think there are too many use cases where people put generated code or examples in directories that start with . or _. Omitting those would be more confusing than helpful.
Quoting @dmitshur's comment from CL 202042.
I don't think there's any scenario where a .git directory should be included in a module zip file.
CreateFromDir
is indeed intended to be a convenience function, and including these directories significantly diminishes its value. We should exclude these, along with other VCS directory names.The text was updated successfully, but these errors were encountered: