mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-15 14:36:48 +02:00
fix: io buffer not shrinked before putting back to pool
This commit is contained in:
parent
3b4deccd8e
commit
18ab6c52ec
1 changed files with 1 additions and 1 deletions
|
@ -145,7 +145,7 @@ func CopyClose(dst *ContextWriter, src *ContextReader) (err error) {
|
||||||
buf = make([]byte, 0, size)
|
buf = make([]byte, 0, size)
|
||||||
} else {
|
} else {
|
||||||
buf = copyBufPool.Get().([]byte)
|
buf = copyBufPool.Get().([]byte)
|
||||||
defer copyBufPool.Put(buf)
|
defer copyBufPool.Put(buf[:0])
|
||||||
}
|
}
|
||||||
// close both as soon as one of them is done
|
// close both as soon as one of them is done
|
||||||
wCloser, wCanClose := dst.Writer.(io.Closer)
|
wCloser, wCanClose := dst.Writer.(io.Closer)
|
||||||
|
|
Loading…
Add table
Reference in a new issue