shad-go/lectures/07-sql/resources/conn.go
2020-04-09 16:03:44 +03:00

16 lines
205 B
Go

package resources
import (
"context"
"database/sql"
"log"
)
func ConnExhaust(ctx context.Context, db *sql.DB) {
c, err := db.Conn(ctx)
if err != nil {
log.Fatal(err)
}
_ = c.PingContext(ctx)
}