code: func localhostLookup() net.IP {
  	if ips, err := net.LookupIP("localhost"); err == nil && len(ips) > 0 {
  		return ips[0]
  	}
  	return nil
  }
docs: // localhostLookup looks for a loopback IP by resolving localhost.