github.com/chanxuehong/wechat@v0.0.0-20230222024006-36f0325263cd/mch/core/buffer_pool.go (about)

     1  package core
     2  
     3  import (
     4  	"bytes"
     5  	"sync"
     6  )
     7  
     8  var textBufferPool = sync.Pool{
     9  	New: func() interface{} {
    10  		return bytes.NewBuffer(make([]byte, 0, 4<<10)) // 4KB
    11  	},
    12  }