MCPcopy
hub / github.com/uber-go/zap / Get

Method Get

internal/pool/pool.go:51–53  ·  view source on GitHub ↗

Get gets a T from the pool, or creates a new one if the pool is empty.

()

Source from the content-addressed store, hash-verified

49
50// Get gets a T from the pool, or creates a new one if the pool is empty.
51func (p *Pool[T]) Get() T {
52 return p.pool.Get().(T)
53}
54
55// Put returns x into the pool.
56func (p *Pool[T]) Put(x T) {

Callers 4

TestNewFunction · 0.45
TestNew_RaceFunction · 0.45
CaptureFunction · 0.45
TakeFunction · 0.45

Calls

no outgoing calls

Tested by 2

TestNewFunction · 0.36
TestNew_RaceFunction · 0.36