mirror of
https://github.com/go-micro/go-micro.git
synced 2024-11-24 08:02:32 +02:00
22 lines
241 B
Go
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}
|
|
}
|