Fix formatting.

Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
Ben Kochie 2018-04-14 15:02:20 +02:00
parent 4c863f3b5d
commit 0507b0c9a2
Failed to extract signature
1 changed files with 7 additions and 7 deletions

View File

@ -52,7 +52,7 @@ func parseNetDevStats(r io.Reader, ignore *regexp.Regexp) (map[string]map[string
receiveHeader := strings.Fields(parts[1])
transmitHeader := strings.Fields(parts[2])
headerLength := len(receiveHeader)+len(transmitHeader)+1
headerLength := len(receiveHeader) + len(transmitHeader) + 1
netDev := map[string]map[string]string{}
for scanner.Scan() {
@ -68,13 +68,13 @@ func parseNetDevStats(r io.Reader, ignore *regexp.Regexp) (map[string]map[string
continue
}
netDev[dev] = map[string]string{}
for i := 0; i < len(receiveHeader); i++ {
netDev[dev]["receive_"+receiveHeader[i]] = parts[i+1]
}
for i := 0; i < len(receiveHeader); i++ {
netDev[dev]["receive_"+receiveHeader[i]] = parts[i+1]
}
for i := 0; i < len(transmitHeader); i++ {
netDev[dev]["transmit_"+transmitHeader[i]] = parts[i+1+len(receiveHeader)]
}
for i := 0; i < len(transmitHeader); i++ {
netDev[dev]["transmit_"+transmitHeader[i]] = parts[i+1+len(receiveHeader)]
}
}
return netDev, scanner.Err()
}