Fixed Error return value of is not checked (errcheck)

This commit is contained in:
Holger Obermaier
2026-02-05 14:48:49 +01:00
parent a77cc19ddb
commit 8f49c7aa67
9 changed files with 81 additions and 16 deletions

View File

@@ -58,7 +58,11 @@ func getStats(filename string) map[string]MemstatStats {
if err != nil {
cclog.Error(err.Error())
}
defer file.Close()
defer func() {
if err := file.Close(); err != nil {
cclog.Error(err.Error())
}
}()
scanner := bufio.NewScanner(file)
for scanner.Scan() {