code: func IsLocalHost(hostport string) bool {
  	host, _, err := net.SplitHostPort(hostport)
  	if err != nil {
  		return false
  	}
  	switch {
  	case host == "localhost", host == "":
  	case net.ParseIP(host).IsLoopback():
  
  	default:
  		return false
  	}
  	return true
  }
docs: // IsLocalHost returns true if hostport is local.