Get rid of unnecessary import alias

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
Milos Gajdos 2023-07-14 10:32:42 +01:00
parent a3eb956464
commit 316e1c6b82
No known key found for this signature in database
GPG key ID: 01300E5E6D417439

View file

@ -4,7 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"net/url" "net/url"
pathutil "path" "path"
storagedriver "github.com/docker/distribution/registry/storage/driver" storagedriver "github.com/docker/distribution/registry/storage/driver"
storagemiddleware "github.com/docker/distribution/registry/storage/driver/middleware" 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 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 != "" { 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 return u.String(), nil
} }