mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
registryurl: deprecate GetHostname(), GetPort()
These were just wrappers for url.Hostname() and url.Port() Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -28,7 +28,7 @@ func Parse(registryURL string) (*url.URL, error) {
|
||||
return nil, errors.New("unsupported scheme: " + u.Scheme)
|
||||
}
|
||||
|
||||
if GetHostname(u) == "" {
|
||||
if u.Hostname() == "" {
|
||||
return nil, errors.New("no hostname in URL")
|
||||
}
|
||||
|
||||
@@ -37,11 +37,15 @@ func Parse(registryURL string) (*url.URL, error) {
|
||||
}
|
||||
|
||||
// GetHostname returns the hostname of the URL
|
||||
//
|
||||
// Deprecated: use url.Hostname()
|
||||
func GetHostname(u *url.URL) string {
|
||||
return u.Hostname()
|
||||
}
|
||||
|
||||
// GetPort returns the port number of the URL
|
||||
//
|
||||
// Deprecated: use url.Port()
|
||||
func GetPort(u *url.URL) string {
|
||||
return u.Port()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user