add errcheck for Digest method in sign.go

Signed-off-by: Tariq Ibrahim <tariq181290@gmail.com>
release-2.14
Tariq Ibrahim 6 years ago committed by Matthew Fisher
parent 2420009a75
commit 4a0eb2ac6e
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -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