Closed beyang closed 6 years ago
Thanks for the PR, but please see https://github.com/shurcooL/vfsgen/pull/40#issuecomment-355416103.
There is an open issue #31 to improve this situation, since this is a common feature request (e.g., there was yet another similar PR #54 recently).
This adds a
ModTime
field to theOptions
struct, which lets the caller specify a modification time for all generated files. As the docstring states, this is useful in cases where the generated VFS file should change only if the actual file contents (ignoring modification time).A concrete case is when the generated file is committed to a git repository and there is a CI job that runs
go generate
and verifies thatgit diff
is empty. Prior to this change the CI job would always fail, because it would generate a VFS file with modification times inherited from the CI filesystem, resulting in a non-zero diff.