code: func (c *Cache) Write(key []byte, values []Value) error {
  	c.init()
  	addedSize := uint64(Values(values).Size())
  
  	// Enough room in the cache?
  	limit := c.maxSize
  	n := c.Size() + addedSize
  
  	if limit > 0 && n > limit {
  		c.tracker.IncWritesErr()
  		c.tracker.AddWrittenBytesDrop(uint64(addedSize))
  		return ErrCacheMemorySizeLimitExceeded(n, limit)
  	}
  
  	newKey, err := c.store.write(key, values)
  	if err != nil {
  		c.tracker.IncWritesErr()
  		c.tracker.AddWrittenBytesErr(uint64(addedSize))
  		return err
  	}
  
  	if newKey {
  		addedSize += uint64(len(key))
  	}
  	// Update the cache size and the memory size stat.
  	c.tracker.IncCacheSize(addedSize)
  	c.tracker.AddMemBytes(addedSize)
  	c.tracker.AddWrittenBytesOK(uint64(addedSize))
  	c.tracker.IncWritesOK()
  
  	return nil
  }
docs: // Write writes the set of values for the key to the cache. This function is goroutine-safe.
  // It returns an error if the cache will exceed its max size by adding the new values.