1 parent d3129e5 commit a69dfc6Copy full SHA for a69dfc6
1 file changed
chapter7/patterns/pool/main/main.go
@@ -30,12 +30,12 @@ func (dbConn *dbConnection) Close() {
30
fmt.Println("Close: Connection", dbConn.ID)
31
}
32
33
-var counter int32
+var idCounter int32
34
35
// createConnection is a factory method called by the pool
36
// framework when new connections are needed.
37
func createConnection() (pool.Resource, error) {
38
- id := atomic.AddInt32(&counter, 1)
+ id := atomic.AddInt32(&idCounter, 1)
39
fmt.Println("Create: New Connection", id)
40
41
return &dbConnection{id}, nil
0 commit comments