MCPcopy Create free account
hub / github.com/goinaction/code / createConnection

Function createConnection

chapter7/patterns/pool/main/main.go:39–44  ·  view source on GitHub ↗

createConnection is a factory method that will be called by the pool when a new connection is needed.

()

Source from the content-addressed store, hash-verified

37// createConnection is a factory method that will be called by
38// the pool when a new connection is needed.
39func createConnection() (io.Closer, error) {
40 id := atomic.AddInt32(&idCounter, 1)
41 log.Println("Create: New Connection", id)
42
43 return &dbConnection{id}, nil
44}
45
46// main is the entry point for all Go programs.
47func main() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected