From 316e1c6b82bd2f84e3fe534254c5db7c58e42813 Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Fri, 14 Jul 2023 10:32:42 +0100 Subject: [PATCH] Get rid of unnecessary import alias Signed-off-by: Milos Gajdos --- registry/storage/driver/middleware/redirect/middleware.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/registry/storage/driver/middleware/redirect/middleware.go b/registry/storage/driver/middleware/redirect/middleware.go index 4a458461..39364bee 100644 --- a/registry/storage/driver/middleware/redirect/middleware.go +++ b/registry/storage/driver/middleware/redirect/middleware.go @@ -4,7 +4,7 @@ import ( "context" "fmt" "net/url" - pathutil "path" + "path" storagedriver "github.com/docker/distribution/registry/storage/driver" storagemiddleware "github.com/docker/distribution/registry/storage/driver/middleware" @@ -42,11 +42,11 @@ func newRedirectStorageMiddleware(sd storagedriver.StorageDriver, options map[st return &redirectStorageMiddleware{StorageDriver: sd, scheme: u.Scheme, host: u.Host, basePath: u.Path}, nil } -func (r *redirectStorageMiddleware) URLFor(ctx context.Context, path string, options map[string]interface{}) (string, error) { +func (r *redirectStorageMiddleware) URLFor(ctx context.Context, urlPath string, options map[string]interface{}) (string, error) { if r.basePath != "" { - path = pathutil.Join(r.basePath, path) + urlPath = path.Join(r.basePath, urlPath) } - u := &url.URL{Scheme: r.scheme, Host: r.host, Path: path} + u := &url.URL{Scheme: r.scheme, Host: r.host, Path: urlPath} return u.String(), nil }