From 83d0df9cdceeb90f9cd0adab2e2985a8742777d5 Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Thu, 24 Sep 2015 20:21:23 -0700 Subject: [PATCH] Make Close() on simpleReaderCloser actually close the reader Signed-off-by: Doug Davis --- ioutils/readers_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ioutils/readers_test.go b/ioutils/readers_test.go index 5eeda96..5c26a2a 100644 --- a/ioutils/readers_test.go +++ b/ioutils/readers_test.go @@ -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 }