mirror of https://bitbucket.org/ausocean/av.git
stream: fixed comment of NopEncoder simplified Write for noop
This commit is contained in:
parent
9b3a1d0ae7
commit
00f2b66a8b
|
@ -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 }
|
||||
|
|
Loading…
Reference in New Issue