diff --git a/buffer.go b/buffer.go deleted file mode 100644 index c43bb23..0000000 --- a/buffer.go +++ /dev/null @@ -1,14 +0,0 @@ -package grpc - -import ( - "bytes" -) - -type buffer struct { - *bytes.Buffer -} - -func (b *buffer) Close() error { - b.Buffer.Reset() - return nil -} diff --git a/subscriber.go b/subscriber.go index 97b9d75..3bd4abe 100644 --- a/subscriber.go +++ b/subscriber.go @@ -12,6 +12,7 @@ import ( "github.com/micro/go-micro/metadata" "github.com/micro/go-micro/registry" "github.com/micro/go-micro/server" + "github.com/micro/go-micro/util/buf" ) const ( @@ -204,7 +205,7 @@ func (g *grpcServer) createSubHandler(sb *subscriber, opts server.Options) broke req = req.Elem() } - b := &buffer{bytes.NewBuffer(msg.Body)} + b := buf.New(bytes.NewBuffer(msg.Body)) co := cf(b) defer co.Close()