github.com/mdaxf/iac@v0.0.0-20240519030858-58a061660378/vendor_skip/gopkg.in/alexcesaro/quotedprintable.v3/pool_go12.go (about)

     1  // +build !go1.3
     2  
     3  package quotedprintable
     4  
     5  import "bytes"
     6  
     7  var ch = make(chan *bytes.Buffer, 32)
     8  
     9  func getBuffer() *bytes.Buffer {
    10  	select {
    11  	case buf := <-ch:
    12  		return buf
    13  	default:
    14  	}
    15  	return new(bytes.Buffer)
    16  }
    17  
    18  func putBuffer(buf *bytes.Buffer) {
    19  	buf.Reset()
    20  	select {
    21  	case ch <- buf:
    22  	default:
    23  	}
    24  }