1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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 de41640435
commit b5265fe7ad

View file

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