add errcheck for Digest method in sign.go

Signed-off-by: Tariq Ibrahim <tariq181290@gmail.com>
pull/5672/head
Tariq Ibrahim 6 years ago
parent 609e3ace5d
commit 86b970600b
No known key found for this signature in database
GPG Key ID: DFC94E4A008B908A

@ -404,6 +404,8 @@ func DigestFile(filename string) (string, error) {
// Helm uses SHA256 as its default hash for all non-cryptographic applications.
func Digest(in io.Reader) (string, error) {
hash := crypto.SHA256.New()
io.Copy(hash, in)
if _, err := io.Copy(hash, in); err != nil {
return "", nil
}
return hex.EncodeToString(hash.Sum(nil)), nil
}

Loading…
Cancel
Save