mirror of
https://github.com/panjf2000/ants.git
synced 2025-12-16 18:11:03 +00:00
gofmt
This commit is contained in:
parent
339aaa4475
commit
6da1112dff
1
ants.go
1
ants.go
@ -68,4 +68,3 @@ var (
|
||||
ErrPoolSizeInvalid = errors.New("invalid size for pool")
|
||||
ErrPoolClosed = errors.New("this pool has been closed")
|
||||
)
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@ func BenchmarkGoroutineWithFunc(b *testing.B) {
|
||||
|
||||
func BenchmarkAntsPoolWithFunc(b *testing.B) {
|
||||
var wg sync.WaitGroup
|
||||
p, _ := ants.NewPoolWithFunc(50000, 1,func(i interface{}) error {
|
||||
p, _ := ants.NewPoolWithFunc(50000, 1, func(i interface{}) error {
|
||||
demoPoolFunc(i)
|
||||
wg.Done()
|
||||
return nil
|
||||
|
||||
3
pool.go
3
pool.go
@ -87,7 +87,6 @@ func (p *Pool) monitorAndClear() {
|
||||
}()
|
||||
}
|
||||
|
||||
|
||||
// NewPool generates a instance of ants pool
|
||||
func NewPool(size, expiry int) (*Pool, error) {
|
||||
if size <= 0 {
|
||||
@ -138,7 +137,7 @@ func (p *Pool) Release() error {
|
||||
for i := 0; i < running; i++ {
|
||||
p.getWorker().stop()
|
||||
}
|
||||
for i := range p.workers{
|
||||
for i := range p.workers {
|
||||
p.workers[i] = nil
|
||||
}
|
||||
})
|
||||
|
||||
@ -142,7 +142,7 @@ func (p *PoolWithFunc) Release() error {
|
||||
for i := 0; i < running; i++ {
|
||||
p.getWorker().stop()
|
||||
}
|
||||
for i := range p.workers{
|
||||
for i := range p.workers {
|
||||
p.workers[i] = nil
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user