Skip to content
/ bpool Public

Package bpool is a minimal wrapper using sync.Pool for *bytes.Buffer.

License

Notifications You must be signed in to change notification settings

johejo/bpool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bpool

ci PkgGoDev codecov Go Report Card

Package bpool is a minimal wrapper using sync.Pool for *bytes.Buffer.

Example

package bpool_test

import (
	"testing"

	"github.com/johejo/bpool"
)

var pool = bpool.New()

func Example() {
	buf := pool.Get()
	defer pool.Put(buf)
	for i := 0; i < 1024; i++ {
		buf.WriteString("hello")
	}
	println(buf.String())
}

License

MIT

Author

Mitsuo Heijo(@johejo)

About

Package bpool is a minimal wrapper using sync.Pool for *bytes.Buffer.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages