all: fix ineffectual assignments and remove uses of crypto.Sha3

go get github.com/gordonklaus/ineffassign
ineffassign .
This commit is contained in:
Felix Lange
2017-01-09 11:16:06 +01:00
parent 0f34d506b5
commit b9b3efb09f
31 changed files with 109 additions and 104 deletions

View File

@ -47,15 +47,16 @@ func ReadDiskStats(stats *DiskStats) error {
}
return err
}
key, value := "", int64(0)
if parts := strings.Split(line, ":"); len(parts) != 2 {
parts := strings.Split(line, ":")
if len(parts) != 2 {
continue
} else {
key = strings.TrimSpace(parts[0])
if value, err = strconv.ParseInt(strings.TrimSpace(parts[1]), 10, 64); err != nil {
return err
}
}
key := strings.TrimSpace(parts[0])
value, err := strconv.ParseInt(strings.TrimSpace(parts[1]), 10, 64)
if err != nil {
return err
}
// Update the counter based on the key
switch key {
case "syscr":