Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
pool
✓ gopkg.in/fatih/pool.v2
Creates a connection pool and retrieves a connection.
package main
import (
"fmt"
"net"
"gopkg.in/fatih/pool.v2"
)
func main() {
p, err := pool.NewChannelPool(5, 30, func() (net.Conn, error) {
return net.Dial("tcp", "example.com:80")
})
if err != nil {
fmt.Println(err)
return
}
defer p.Close()
conn, _ := p.Get()
defer conn.Close()
fmt.Println("Got connection from pool")
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
2.0.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.