From ccf933b29a6966adce5b5c722119c94ca5a07c5c Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Thu, 23 May 2019 10:54:06 -0700 Subject: [PATCH] return error when io.Copy fails in Digest Signed-off-by: Tariq Ibrahim --- pkg/provenance/sign.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/provenance/sign.go b/pkg/provenance/sign.go index 5a7626424..26ae26031 100644 --- a/pkg/provenance/sign.go +++ b/pkg/provenance/sign.go @@ -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 }