Skip to content

Commit 4d58d76

Browse files
author
gbbr
committed
Removed variable from global scope
1 parent 39cabdf commit 4d58d76

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ const (
1919
pooledResources = 2 // number of resources in the pool
2020
)
2121

22-
var (
23-
connectionID int32 // counter
24-
wg sync.WaitGroup // waits for program to finish
25-
)
22+
var connectionID int32 // counter
2623

2724
// dbConnection simulates a resource to share.
2825
type dbConnection struct {
@@ -46,6 +43,7 @@ func createConnection() (pool.Resource, error) {
4643

4744
// main is the entry point for all Go programs.
4845
func main() {
46+
var wg sync.WaitGroup // waits for program to finish
4947
wg.Add(maxGoroutines)
5048

5149
// Create the buffered channel to hold

0 commit comments

Comments
 (0)