code: func loopbackIP() net.IP {
  	interfaces, err := net.Interfaces()
  	if err != nil {
  		return nil
  	}
  	for _, inf := range interfaces {
  		const flagUpLoopback = net.FlagUp | net.FlagLoopback
  		if inf.Flags&flagUpLoopback == flagUpLoopback {
  			addrs, _ := inf.Addrs()
  			for _, addr := range addrs {
  				ip, _, err := net.ParseCIDR(addr.String())
  				if err == nil && ip.IsLoopback() {
  					return ip
  				}
  			}
  		}
  	}
  	return nil
  }
docs: // loopbackIP returns the first loopback IP address sniffing network
  // interfaces or nil if none is found.