MCPcopy
hub / github.com/go-sql-driver/mysql / takeSmallBuffer

Method takeSmallBuffer

buffer.go:126–131  ·  view source on GitHub ↗

takeSmallBuffer is shortcut which can be used if length is known to be smaller than defaultBufSize. Only one buffer (total) can be used at a time.

(length int)

Source from the content-addressed store, hash-verified

124// known to be smaller than defaultBufSize.
125// Only one buffer (total) can be used at a time.
126func (b *buffer) takeSmallBuffer(length int) ([]byte, error) {
127 if b.busy() {
128 return nil, ErrBusyBuffer
129 }
130 return b.cachedBuf[:length], nil
131}
132
133// takeCompleteBuffer returns the complete existing buffer.
134// This can be used if the necessary buffer size is unknown.

Callers 4

writeCommandPacketMethod · 0.80
handleAuthResultMethod · 0.80

Calls 1

busyMethod · 0.95

Tested by

no test coverage detected