move all the buffer references to util/buf

This commit is contained in:
Asim Aslam
2019-07-28 19:33:24 +01:00
parent f2669e7b1e
commit 1db98ee0f0
9 changed files with 25 additions and 64 deletions

21
util/buf/buf.go Normal file
View File

@@ -0,0 +1,21 @@
package buf
import (
"bytes"
)
type buffer struct {
*bytes.Buffer
}
func (b *buffer) Close() error {
b.Buffer.Reset()
return nil
}
func New(b *bytes.Buffer) *buffer {
if b == nil {
b = bytes.NewBuffer(nil)
}
return &buffer{b}
}