Storing non-pointer values in sync.Pool allocates memory SCC-SA6002
Performance
Major
6 months ago3 years old
argument should be pointer-like to avoid allocations
669// it only operates the first one of mutil-upload form file field.
670func (c *Controller) SaveToFile(fromFile, toFile string) error {
671	buf := copyBufferPool.Get().([]byte)
672	defer copyBufferPool.Put(buf)673	return c.SaveToFileWithBuffer(fromFile, toFile, buf)
674}
675