diff --git a/digest.go b/digest.go index 518b5e7..cf80da8 100644 --- a/digest.go +++ b/digest.go @@ -80,7 +80,10 @@ var ( // be returned if the format is invalid. func Parse(s string) (Digest, error) { d := Digest(s) - return d, d.Validate() + if err := d.Validate(); err != nil { + return "", err + } + return d, nil } // FromReader consumes the content of rd until io.EOF, returning canonical digest.