Close returns error, to satisfy the io.Closer interface.

This commit is contained in:
Sebastian Zagrodzki
2017-04-27 02:48:43 +02:00
parent 76f4548b85
commit a1b915080e

View File

@@ -119,8 +119,9 @@ func (r ReadStream) Read(p []byte) (int, error) {
// in progress before returning an io.EOF error, unless another error
// was encountered earlier.
// Close cannot be called concurrently with Read.
func (r ReadStream) Close() {
func (r ReadStream) Close() error {
r.s.setDelayedErr(io.EOF)
return nil
}
// WriteStream is a buffer that will send data asynchronously, reducing