Merge pull request #5790 from tariq1890/fix_sign

return error and fix error handling when io.Copy fails in Digest
pull/5809/head
Matthew Fisher 6 years ago committed by GitHub
commit 90f50a11db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -405,7 +405,7 @@ func DigestFile(filename string) (string, error) {
func Digest(in io.Reader) (string, error) {
hash := crypto.SHA256.New()
if _, err := io.Copy(hash, in); err != nil {
return "", nil
return "", err
}
return hex.EncodeToString(hash.Sum(nil)), nil
}

Loading…
Cancel
Save