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:
parent
de41640435
commit
b5265fe7ad
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue