code: func New2QParams(size int, recentRatio float64, ghostRatio float64) (*TwoQueueCache, error) {
  	if size <= 0 {
  		return nil, fmt.Errorf("invalid size")
  	}
  	if recentRatio < 0.0 || recentRatio > 1.0 {
  		return nil, fmt.Errorf("invalid recent ratio")
  	}
  	if ghostRatio < 0.0 || ghostRatio > 1.0 {
  		return nil, fmt.Errorf("invalid ghost ratio")
  	}
  
  	// Determine the sub-sizes
  	recentSize := int(float64(size) * recentRatio)
  	evictSize := int(float64(size) * ghostRatio)
  
  	// Allocate the LRUs
  	recent, err := simplelru.NewLRU(size, nil)
  	if err != nil {
  		return nil, err
  	}
  	frequent, err := simplelru.NewLRU(size, nil)
  	if err != nil {
  		return nil, err
  	}
  	recentEvict, err := simplelru.NewLRU(evictSize, nil)
  	if err != nil {
  		return nil, err
  	}
  
  	// Initialize the cache
  	c := &TwoQueueCache{
  		size:        size,
  		recentSize:  recentSize,
  		recent:      recent,
  		frequent:    frequent,
  		recentEvict: recentEvict,
  	}
  	return c, nil
  }
docs: // New2QParams creates a new TwoQueueCache using the provided
  // parameter values.