mirror of
https://github.com/joohoi/acme-dns.git
synced 2025-01-24 01:35:43 +07:00
22 lines
396 B
Go
22 lines
396 B
Go
package bytebufferpool_test
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/valyala/bytebufferpool"
|
|
)
|
|
|
|
func ExampleByteBuffer() {
|
|
bb := bytebufferpool.Get()
|
|
|
|
bb.WriteString("first line\n")
|
|
bb.Write([]byte("second line\n"))
|
|
bb.B = append(bb.B, "third line\n"...)
|
|
|
|
fmt.Printf("bytebuffer contents=%q", bb.B)
|
|
|
|
// It is safe to release byte buffer now, since it is
|
|
// no longer used.
|
|
bytebufferpool.Put(bb)
|
|
}
|