lint: fix unhandled errors

This commit is contained in:
Ondřej Budai 2020-02-28 23:00:46 +01:00 committed by Tom Gundersen
parent 9bef739621
commit d7cbc22da4
12 changed files with 151 additions and 56 deletions

View file

@ -243,7 +243,10 @@ func randomSHA1String() (string, error) {
} else if n != 20 {
return "", errors.New("randomSHA1String: short read from rand")
}
hash.Write(data)
_, err = hash.Write(data)
if err != nil {
return "", err
}
return hex.EncodeToString(hash.Sum(nil)), nil
}