micro/util/buf/buf.go
2019-07-28 19:33:24 +01:00

22 lines
241 B
Go

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}
}