Unverified Commit 55e87b68 authored by Matthew Fisher's avatar Matthew Fisher Committed by GitHub

Merge pull request #5672 from tariq1890/err_digest

add errcheck for Digest method in sign.go
parents a93ebe17 86b97060
...@@ -404,6 +404,8 @@ func DigestFile(filename string) (string, error) { ...@@ -404,6 +404,8 @@ func DigestFile(filename string) (string, error) {
// Helm uses SHA256 as its default hash for all non-cryptographic applications. // Helm uses SHA256 as its default hash for all non-cryptographic applications.
func Digest(in io.Reader) (string, error) { func Digest(in io.Reader) (string, error) {
hash := crypto.SHA256.New() 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 return hex.EncodeToString(hash.Sum(nil)), nil
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment