Merge pull request #2001 from aaronlehmann/simplify-splithostname

reference: Simplify SplitHostname
This commit is contained in:
Derek McGowan 2016-10-13 15:37:33 -07:00 committed by GitHub
commit 04c8db562d

View file

@ -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]