Skip to content

Commit b9e6ffe

Browse files
committed
fix static check
Signed-off-by: Marina Moore <mnm678@gmail.com>
1 parent 819834f commit b9e6ffe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/client.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,10 @@ func (c *Client) Download(name string, dest Destination) (err error) {
841841
}
842842

843843
func (c *Client) VerifyDigest(digest string, digestAlg string, length int64, path string) (err error) {
844-
localMeta, _ := c.targets[path]
844+
localMeta, ok := c.targets[path]
845+
if !ok {
846+
return ErrUnknownTarget{Name: path, SnapshotVersion: c.snapshotVer}
847+
}
845848

846849
actual := data.FileMeta{Length: length, Hashes: make(data.Hashes, 1)}
847850
actual.Hashes[digestAlg], err = hex.DecodeString(digest)

0 commit comments

Comments
 (0)