Skip to content

Commit 511587e

Browse files
author
gbbr
committed
Fixed struct
1 parent 2e55402 commit 511587e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎chapter7/patterns/pool/main/main.go‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ var (
2525
)
2626

2727
// dbConnection simulates a resource to share.
28-
type dbConnection struct{ ID int32 }
28+
type dbConnection struct {
29+
ID int32
30+
}
2931

3032
// Close implements the interface for the pool package.
3133
// Close performs any resource release management.

‎chapter7/patterns/pool/pool.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ type pool struct {
4141
// unbuffered pool.
4242
var ErrInvalidCapacity = errors.New("Capacity needs to be greater than zero.")
4343

44-
// New creates a pool from a set of factory functions. pool provides a set of
45-
// resources that can be shared safely by multiple goroutines
44+
// New creates a pool from a set of factory functions. A pool provides capacity
45+
// number of resources that can be shared safely by multiple goroutines.
4646
func New(fn func() (Resource, error), capacity uint) (*pool, error) {
4747
if capacity == 0 {
4848
return nil, ErrInvalidCapacity

0 commit comments

Comments
 (0)