code: func FindBestEwmhIcon(width, height int, icons []ewmh.WmIcon) *ewmh.WmIcon {
  	// nada nada limonada
  	if len(icons) == 0 {
  		return nil
  	}
  
  	parea := width * height // preferred size
  	best := -1
  
  	// If zero area, set it to the largest possible.
  	if parea == 0 {
  		parea = math.MaxInt32
  	}
  
  	var bestArea, iconArea int
  
  	for i, icon := range icons {
  		// the first valid icon we've seen; use it!
  		if best == -1 {
  			best = i
  			continue
  		}
  
  		// load areas for comparison
  		bestArea = int(icons[best].Width * icons[best].Height)
  		iconArea = int(icon.Width * icon.Height)
  
  		// We don't always want to accept bigger icons if our best is
  		// already bigger. But we always want something bigger if our best
  		// is insufficient.
  		if (iconArea >= parea && iconArea <= bestArea) ||
  			(bestArea < parea && iconArea > bestArea) {
  			best = i
  		}
  	}
  
  	if best > -1 {
  		return &icons[best]
  	}
  	return nil
  }
docs: // FindBestEwmhIcon takes width/height dimensions and a slice of *ewmh.WmIcon
  // and finds the best matching icon of the bunch. We always prefer bigger.
  // If no icons are bigger than the preferred dimensions, use the biggest
  // available. Otherwise, use the smallest icon that is greater than or equal
  // to the preferred dimensions. The preferred dimensions is essentially
  // what you'll likely scale the resulting icon to.
  // If width and height are 0, then the largest icon found will be returned.