code: func IPPart(s string) string {
  	if ip := net.ParseIP(s); ip != nil {
  		// IP address without port
  		return s
  	}
  	// Must be IP:port
  	host, _, err := net.SplitHostPort(s)
  	if err != nil {
  		klog.Errorf("Error parsing '%s': %v", s, err)
  		return ""
  	}
  	// Check if host string is a valid IP address
  	if ip := net.ParseIP(host); ip != nil {
  		return ip.String()
  	} else {
  		klog.Errorf("invalid IP part '%s'", host)
  	}
  	return ""
  }
docs: // IPPart returns just the IP part of an IP or IP:port or endpoint string. If the IP
  // part is an IPv6 address enclosed in brackets (e.g. "[fd00:1::5]:9999"),
  // then the brackets are stripped as well.