Skip to content

Commit

Permalink
Fix accidently empty lines in meminfo_linux
Browse files Browse the repository at this point in the history
Signed-off-by: qwertysun <qwertysun@tencent.com>

asd
  • Loading branch information
qwertysun committed Apr 10, 2020
1 parent d4d2e1d commit 91a9c8f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions collector/meminfo_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ func parseMemInfo(r io.Reader) (map[string]float64, error) {
for scanner.Scan() {
line := scanner.Text()
parts := strings.Fields(line)
if len(parts) == 0 {
continue
}
fv, err := strconv.ParseFloat(parts[1], 64)
if err != nil {
return nil, fmt.Errorf("invalid value in meminfo: %s", err)
Expand Down

0 comments on commit 91a9c8f

Please sign in to comment.