1
0
Fork 1
mirror of https://github.com/distribution/distribution synced 2024-09-05 18:38:53 +00:00

reference: Simplify SplitHostname

This nil check is not necessary.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
Aaron Lehmann 2016-10-13 14:51:37 -07:00
parent 252cc27ab1
commit ab6ae11bc1

View file

@ -138,7 +138,7 @@ type Canonical interface {
func SplitHostname(named Named) (string, string) {
name := named.Name()
match := anchoredNameRegexp.FindStringSubmatch(name)
if match == nil || len(match) != 3 {
if len(match) != 3 {
return "", name
}
return match[1], match[2]