Fix scanner usage without error handling

This commit is contained in:
Tobias Schmidt 2017-02-28 14:31:35 -04:00
commit 084e585c2a
11 changed files with 33 additions and 38 deletions

View file

@ -95,6 +95,9 @@ func parseSockStats(r io.Reader, fileName string) (map[string]map[string]string,
i++
}
}
if err := scanner.Err(); err != nil {
return nil, err
}
// The mem metrics is the count of pages used. Multiply the mem metrics by
// the page size from the kernel to get the number of bytes used.