util.go: fix gosimple warning

Fix this warning from gosimple linter:

>	util.go:127:19: S1040: type assertion to the same type: ref.DockerReference() already has type reference.Named (gosimple)
>			if named, ok := ref.DockerReference().(reference.Named); ok {
>					^

Since containers/image commit dfe2fafaa2d702e5a932721aed55b996024051b1
(made in 2017), DockerReference() always return reference.Named type.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2022-01-17 18:24:23 -08:00
parent da00c99dbe
commit b34e4d5789
1 changed files with 2 additions and 2 deletions

View File

@ -123,8 +123,8 @@ func isRegistryBlocked(registry string, sc *types.SystemContext) (bool, error) {
// isReferenceSomething checks if the registry part of a reference is insecure or blocked // isReferenceSomething checks if the registry part of a reference is insecure or blocked
func isReferenceSomething(ref types.ImageReference, sc *types.SystemContext, what func(string, *types.SystemContext) (bool, error)) (bool, error) { func isReferenceSomething(ref types.ImageReference, sc *types.SystemContext, what func(string, *types.SystemContext) (bool, error)) (bool, error) {
if ref != nil && ref.DockerReference() != nil { if ref != nil {
if named, ok := ref.DockerReference().(reference.Named); ok { if named := ref.DockerReference(); named != nil {
if domain := reference.Domain(named); domain != "" { if domain := reference.Domain(named); domain != "" {
return what(domain, sc) return what(domain, sc)
} }