aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/feed/meta.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/feed/meta.go b/internal/feed/meta.go
index cb7d7a5..fd46025 100644
--- a/internal/feed/meta.go
+++ b/internal/feed/meta.go
@@ -86,7 +86,9 @@ func NewMeta(r io.Reader) (*Meta, error) {
// save to buffer, check for error
len := copy(m.Sha256[:], buf[0:32])
if len != 32 {
- return nil, fmt.Errorf("invalid sha256 hash copy length: %d", len)
+ // difficult to test, but this basically doesn't happen, see here:
+ // https://github.com/golang/go/blob/2ebe77a2fda1ee9ff6fd9a3e08933ad1ebaea039/src/runtime/slice.go#L247
+ return nil, fmt.Errorf("invalid copy length: %d", len)
}
default:
// return error