consistently use log.Check for logging errors that "should not happen", don't influence application flow

sooner or later, someone will notice one of these messages, which will lead us
to a bug.
This commit is contained in:
Mechiel Lukkien
2023-02-16 13:22:00 +01:00
parent ef8e5fa1a8
commit 5c33640aea
30 changed files with 366 additions and 246 deletions

View File

@ -11,7 +11,8 @@ func SyncDir(dir string) error {
if err != nil {
return fmt.Errorf("open directory: %v", err)
}
xerr := d.Sync()
d.Close()
return xerr
err = d.Sync()
xerr := d.Close()
xlog.Check(xerr, "closing directory after sync")
return err
}