Fix some lint errors in pkg/proxy

This commit is contained in:
Brad Hoekstra
2019-05-09 11:34:56 -04:00
parent 086a86b9e2
commit 62e58a66aa
5 changed files with 45 additions and 18 deletions

View File

@@ -39,12 +39,12 @@ func IPPart(s string) string {
return ""
}
// Check if host string is a valid IP address
if ip := net.ParseIP(host); ip != nil {
return ip.String()
} else {
ip := net.ParseIP(host)
if ip == nil {
klog.Errorf("invalid IP part '%s'", host)
return ""
}
return ""
return ip.String()
}
// PortPart returns just the port part of an endpoint string.