code: func firstIPv4Addr(addrs []net.Addr) (net.IP, error) {
  	for _, a := range addrs {
  		if a.Network() != "ip+net" {
  			continue
  		}
  
  		ip, _, err := net.ParseCIDR(a.String())
  		if err != nil {
  			return nil, err
  		}
  
  		// "If ip is not an IPv4 address, To4 returns nil."
  		// Reference: http://golang.org/pkg/net/#IP.To4
  		if ip4 := ip.To4(); ip4 != nil {
  			return ip4, nil
  		}
  	}
  
  	return nil, nil
  }
docs: // firstIPv4Addr attempts to retrieve the first detected IPv4 address from an
  // input slice of network addresses.