code: func SplitHostPortDefault(input, defaultHost, defaultPort string) (host string, port string) {
  	port = defaultPort
  	s := input
  	lastIndex := strings.LastIndex(input, ":")
  
  	if lastIndex != -1 {
  		if lastIndex > 0 && input[lastIndex-1:lastIndex] != ":" {
  			s = input[:lastIndex]
  			port = input[lastIndex+1:]
  		} else if lastIndex == 0 {
  			s = defaultHost
  			port = input[lastIndex+1:]
  		}
  	} else {
  		port = defaultPort
  	}
  
  	s = strings.Replace(s, "[", "", -1)
  	s = strings.Replace(s, "]", "", -1)
  	port = strings.Replace(port, "[", "", -1)
  	port = strings.Replace(port, "]", "", -1)
  
  	return s, port
  }
docs: // SplitHostPortDefault splits ip address/hostname string by host and port. Defaults used if no match found