Merge pull request #16570 from duglin/ReaderFix

Make Close() on simpleReaderCloser actually close the reader
This commit is contained in:
Brian Goff 2015-09-29 12:55:03 -04:00
commit 92c1310f61

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
}