Skip to content

Commit a69dfc6

Browse files
Changed counter to idCounter.
1 parent d3129e5 commit a69dfc6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

chapter7/patterns/pool/main/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ func (dbConn *dbConnection) Close() {
3030
fmt.Println("Close: Connection", dbConn.ID)
3131
}
3232

33-
var counter int32
33+
var idCounter int32
3434

3535
// createConnection is a factory method called by the pool
3636
// framework when new connections are needed.
3737
func createConnection() (pool.Resource, error) {
38-
id := atomic.AddInt32(&counter, 1)
38+
id := atomic.AddInt32(&idCounter, 1)
3939
fmt.Println("Create: New Connection", id)
4040

4141
return &dbConnection{id}, nil

0 commit comments

Comments
 (0)