Make Close() on simpleReaderCloser actually close the reader

Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
Doug Davis 2015-09-24 20:21:23 -07:00
parent c0bd79f3f8
commit 83d0df9cdc

View file

@ -129,13 +129,16 @@ func TestBufReaderCloseWithNonReaderCloser(t *testing.T) {
}
// implements io.ReadCloser
type simpleReaderCloser struct{}
type simpleReaderCloser struct {
err error
}
func (r *simpleReaderCloser) Read(p []byte) (n int, err error) {
return 0, nil
return 0, r.err
}
func (r *simpleReaderCloser) Close() error {
r.err = io.EOF
return nil
}