Skip to content

Commit

Permalink
staticcheck fix
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed May 3, 2020
1 parent 502950a commit f4c947c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions balance/profile.coverprofile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ github.com/aberic/gnomon/balance/random.go:71.2,71.43 1 100
github.com/aberic/gnomon/balance/random.go:68.15,70.3 1 0
github.com/aberic/gnomon/balance/round.go:28.24,35.2 3 1
github.com/aberic/gnomon/balance/round.go:38.31,40.6 2 1
github.com/aberic/gnomon/balance/round.go:40.6,42.17 2 62321
github.com/aberic/gnomon/balance/round.go:45.3,45.6 1 62520
github.com/aberic/gnomon/balance/round.go:40.6,42.17 2 62966
github.com/aberic/gnomon/balance/round.go:45.3,45.6 1 63171
github.com/aberic/gnomon/balance/round.go:42.17,44.4 1 0
github.com/aberic/gnomon/balance/round.go:50.38,54.2 3 5
github.com/aberic/gnomon/balance/round.go:57.53,59.30 2 0
Expand Down
14 changes: 6 additions & 8 deletions pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"errors"
"io"
"sync"
"time"
)

var errPoolClosed = errors.New("pond closed")
Expand Down Expand Up @@ -66,13 +65,12 @@ func NewPond(minOpen, maxOpen int, factory factory) *Pond {
// Pond 连接池对象
type Pond struct {
sync.Mutex
conn chan Conn
maxOpen int // 池中最大资源数
nowOpen int // 当前池中资源数
minOpen int // 池中最少资源数
closed bool // 池是否已关闭
maxLifetime time.Duration
factory factory // 创建连接的方法
conn chan Conn
maxOpen int // 池中最大资源数
nowOpen int // 当前池中资源数
minOpen int // 池中最少资源数
closed bool // 池是否已关闭
factory factory // 创建连接的方法
}

func (p *Pond) getOrCreate() (Conn, error) {
Expand Down

0 comments on commit f4c947c

Please sign in to comment.