Add more error checks

This commit is contained in:
Alexander Neumann
2021-01-30 17:25:10 +01:00
parent cbd88c457a
commit 200f09522d
11 changed files with 63 additions and 24 deletions
+3 -1
View File
@@ -180,7 +180,9 @@ func isDirExcludedByFile(dir, tagFilename, header string) bool {
Warnf("could not open exclusion tagfile: %v", err)
return false
}
defer f.Close()
defer func() {
_ = f.Close()
}()
buf := make([]byte, len(header))
_, err = io.ReadFull(f, buf)
// EOF is handled with a dedicated message, otherwise the warning were too cryptic