Update docs

This commit is contained in:
Anuraag Agrawal
2022-10-17 16:50:52 +09:00
committed by Ron Evans
parent 29f8d22a2d
commit a834359079
+2 -2
View File
@@ -6,7 +6,7 @@ type Pool struct {
items []interface{}
}
// Get returns the value of calling Pool.New().
// Get returns an item in the pool, or the value of calling Pool.New() if there are no items.
func (p *Pool) Get() interface{} {
if len(p.items) > 0 {
x := p.items[len(p.items)-1]
@@ -19,7 +19,7 @@ func (p *Pool) Get() interface{} {
return p.New()
}
// Put drops the value put into the pool.
// Put adds a value back into the pool.
func (p *Pool) Put(x interface{}) {
p.items = append(p.items, x)
}