From 00f2b66a8bdad97730660ee9f37d9400a0e57291 Mon Sep 17 00:00:00 2001 From: Saxon Date: Thu, 14 Mar 2019 11:30:39 +1030 Subject: [PATCH] stream: fixed comment of NopEncoder simplified Write for noop --- stream/encoding.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stream/encoding.go b/stream/encoding.go index 0cc31eb4..664ec383 100644 --- a/stream/encoding.go +++ b/stream/encoding.go @@ -34,7 +34,7 @@ type Encoder interface { GetDst() io.Writer } -// NopEncoder returns an +// NopEncoder returns an Encoder that performs no operation. func NopEncoder(dst io.Writer) Encoder { return noop{dst} } @@ -45,8 +45,7 @@ type noop struct { // Write implements io.Writer. func (e noop) Write(p []byte) (int, error) { - n, err := e.dst.Write(p) - return n, err + return e.dst.Write(p) } func (e noop) GetDst() io.Writer { return e.dst }