mirror of
https://github.com/distribution/distribution.git
synced 2025-08-06 01:13:47 +00:00
Merge pull request #2001 from aaronlehmann/simplify-splithostname
reference: Simplify SplitHostname
This commit is contained in:
commit
04c8db562d
@ -138,7 +138,7 @@ type Canonical interface {
|
|||||||
func SplitHostname(named Named) (string, string) {
|
func SplitHostname(named Named) (string, string) {
|
||||||
name := named.Name()
|
name := named.Name()
|
||||||
match := anchoredNameRegexp.FindStringSubmatch(name)
|
match := anchoredNameRegexp.FindStringSubmatch(name)
|
||||||
if match == nil || len(match) != 3 {
|
if len(match) != 3 {
|
||||||
return "", name
|
return "", name
|
||||||
}
|
}
|
||||||
return match[1], match[2]
|
return match[1], match[2]
|
||||||
|
Loading…
Reference in New Issue
Block a user