Involved Source Files Package buffer provides a thin wrapper around a byte slice. Unlike the
standard library's bytes.Buffer, it supports a portion of the strconv
package's zero-allocation formatters.pool.go
Package-Level Type Names (total 2, both are exported)
/* sort exporteds by: | */
Buffer is a thin wrapper around a byte slice. It's intended to be pooled, so
the only way to construct one is via a Pool.bs[]bytepoolPool AppendBool appends a bool to the underlying buffer. AppendByte writes a single byte to the Buffer. AppendBytes writes a single byte to the Buffer. AppendFloat appends a float to the underlying buffer. It doesn't quote NaN
or +/- Inf. AppendInt appends an integer to the underlying buffer (assuming base 10). AppendString writes a string to the Buffer. AppendTime appends the time formatted using the specified layout. AppendUint appends an unsigned integer to the underlying buffer (assuming
base 10). Bytes returns a mutable reference to the underlying byte slice. Cap returns the capacity of the underlying byte slice. Free returns the Buffer to its Pool.
Callers must not retain references to the Buffer after calling Free. Len returns the length of the underlying byte slice. Reset resets the underlying byte slice. Subsequent writes re-use the slice's
backing array. String returns a string copy of the underlying byte slice. TrimNewline trims any final "\n" byte from the end of the buffer. Write implements io.Writer. WriteByte writes a single byte to the Buffer.
Error returned is always nil, function signature is compatible
with bytes.Buffer and bufio.Writer WriteString writes a string to the Buffer.
Error returned is always nil, function signature is compatible
with bytes.Buffer and bufio.Writer
*Buffer : fmt.Stringer
*Buffer : internal/bisect.Writer
*Buffer : io.ByteWriter
*Buffer : io.StringWriter
*Buffer : io.Writer
*Buffer : context.stringer
*Buffer : crypto/tls.transcriptHash
*Buffer : net/http.http2stringWriter
*Buffer : runtime.stringer
func Pool.Get() *Buffer
func go.uber.org/zap/zapcore.Encoder.EncodeEntry(zapcore.Entry, []zapcore.Field) (*Buffer, error)
func go.uber.org/zap/internal/stacktrace.NewFormatter(b *Buffer) stacktrace.Formatter
func Pool.put(buf *Buffer)
func go.uber.org/zap/zapcore.safeAppendStringLike[S](appendTo func(*Buffer, S), decodeRune func(S) (rune, int), buf *Buffer, s S)
A Pool is a type-safe wrapper around a sync.Pool.p*pool.Pool[*Buffer] Get retrieves a Buffer from the pool, creating one if necessary.( Pool) put(buf *Buffer)
func NewPool() Pool
var go.uber.org/zap/internal/bufferpool._pool
Package-Level Functions (only one, which is exported)
NewPool constructs a new Pool.
Package-Level Constants (only one, which is unexported)
const_size = 1024 // by default, create 1 KiB buffers
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.