Update docs
Этот коммит содержится в:
родитель
29f8d22a2d
коммит
a834359079
1 изменённых файлов: 2 добавлений и 2 удалений
|
@ -6,7 +6,7 @@ type Pool struct {
|
||||||
items []interface{}
|
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{} {
|
func (p *Pool) Get() interface{} {
|
||||||
if len(p.items) > 0 {
|
if len(p.items) > 0 {
|
||||||
x := p.items[len(p.items)-1]
|
x := p.items[len(p.items)-1]
|
||||||
|
@ -19,7 +19,7 @@ func (p *Pool) Get() interface{} {
|
||||||
return p.New()
|
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{}) {
|
func (p *Pool) Put(x interface{}) {
|
||||||
p.items = append(p.items, x)
|
p.items = append(p.items, x)
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче