int/storage: fix gosimple warning
Fix this warning:
internal/storage/image.go:200:19: S1040: type assertion to the same type: ref already has type reference.Named (gosimple)
if name, ok := ref.(reference.Named); ok {
^
@@ -197,8 +197,7 @@ func (svc *imageService) makeRepoDigests(knownRepoDigests, tags []string, img *s
// it into a canonical reference using the digest and add it to the list.
for _, name := range append(tags, knownRepoDigests...) {
if ref, err2 := reference.ParseNormalizedNamed(name); err2 == nil {
- if name, ok := ref.(reference.Named); ok {
- trimmed := reference.TrimNamed(name)
+ trimmed := reference.TrimNamed(ref)
for _, imageDigest := range imageDigests {
if imageRef, err3 := reference.WithDigest(trimmed, imageDigest); err3 == nil {
if _, ok := digestMap[imageRef.String()]; !ok {
@@ -209,7 +208,6 @@ func (svc *imageService) makeRepoDigests(knownRepoDigests, tags []string, img *s
}
}
}
- }
return imageDigest, repoDigests
}
