Discover Packages
github.com/recallsong/go-utils
buffer
leakybuf
package
Version:
v1.1.1
Opens a new window with list of versions in this module.
Published: Nov 20, 2020
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
LeakyBuf Provides leaky buffer, based on the example in Effective Go.
New creates a leaky buffer which can hold at most n buffer, each
with bufSize bytes.
Get returns a buffer from the leaky buffer or create a new buffer.
Put add the buffer into the free buffer pool for reuse. Panic if the buffer
size is not the same with the leaky buffer's. This is intended to expose
error usage of leaky buffer.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.