diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-02-02 01:53:10 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-02-02 01:53:10 -0500 |
commit | 7d55dd69e3a481fa9885c5fe922c1606bbd928f4 (patch) | |
tree | 1d85c5e20ad630e9c814fca81d546e29098669f8 | |
parent | 153b1997de1b051de57d1b568bc0250e2888a38f (diff) | |
download | cvez-7d55dd69e3a481fa9885c5fe922c1606bbd928f4.tar.bz2 cvez-7d55dd69e3a481fa9885c5fe922c1606bbd928f4.zip |
internal/feed/meta.go: add comment about copy() return value
-rw-r--r-- | internal/feed/meta.go | 4 |
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 |