From 47e2b9efaa164581cd7a33cfda0b3841f08826c9 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sun, 20 May 2018 21:29:38 +0800 Subject: [PATCH] gofmt --- ants_test.go | 4 ++-- pool.go | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ants_test.go b/ants_test.go index 98e50f5..5b87cbb 100644 --- a/ants_test.go +++ b/ants_test.go @@ -20,10 +20,10 @@ package ants_test import ( - "testing" "github.com/panjf2000/ants" - "sync" "runtime" + "sync" + "testing" "time" ) diff --git a/pool.go b/pool.go index 473e7ca..c292151 100644 --- a/pool.go +++ b/pool.go @@ -19,9 +19,9 @@ package ants import ( - "sync/atomic" - "sync" "math" + "sync" + "sync/atomic" "time" ) @@ -33,27 +33,27 @@ type f func() // of goroutines to a given number by recycling goroutines. type Pool struct { // Capacity of the pool. - capacity int32 + capacity int32 // The number of the currently running goroutines. - running int32 + running int32 // Signal is used to notice pool there are available // workers which can be sent to work. freeSignal chan sig // A slice that store the available workers. - workers []*Worker + workers []*Worker workerPool sync.Pool // It is used to notice the pool to closed itself. - release chan sig + release chan sig - lock sync.Mutex + lock sync.Mutex // It is used to confirm whether this pool has been closed. - closed int32 + closed int32 } func NewPool(size int) (*Pool, error) {