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:
parent
da00c99dbe
commit
b34e4d5789
4
util.go
4
util.go
|
@ -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
|
||||
func isReferenceSomething(ref types.ImageReference, sc *types.SystemContext, what func(string, *types.SystemContext) (bool, error)) (bool, error) {
|
||||
if ref != nil && ref.DockerReference() != nil {
|
||||
if named, ok := ref.DockerReference().(reference.Named); ok {
|
||||
if ref != nil {
|
||||
if named := ref.DockerReference(); named != nil {
|
||||
if domain := reference.Domain(named); domain != "" {
|
||||
return what(domain, sc)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue