mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-05 18:13:24 +00:00
`TestInitKeys` verified whether a host key file was regenerated by comparing `os.FileInfo` before and after a `InitDefaultHostKeys` call. On systems where the OS clock / filesystem timestamp granularity is coarse, both writes land in the same tick and get an identical mtime. The resulting `FileInfo` is then byte-for-byte equal even though the key was actually regenerated, so `assert.NotEqual` fails. Since a regenerated key always produces different random bytes, comparing the content can reliably detect regeneration.