Source File
bpool.go
Belonging Package
github.com/coder/websocket/internal/bpool
package bpoolimport ()var bpool = sync.Pool{New: func() any {return &bytes.Buffer{}},}// Get returns a buffer from the pool or creates a new one if// the pool is empty.func () *bytes.Buffer {:= bpool.Get()return .(*bytes.Buffer)}// Put returns a buffer into the pool.func ( *bytes.Buffer) {.Reset()bpool.Put()}
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |