From 7eec915044a15b70fbb5dd0225c819550b05d596 Mon Sep 17 00:00:00 2001 From: ferhat elmas Date: Mon, 19 Feb 2018 17:21:01 +0100 Subject: [PATCH] Fix deferring body close in middleware/compress test (#1063) --- middleware/compress_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/compress_test.go b/middleware/compress_test.go index 0493fd9f..7302de97 100644 --- a/middleware/compress_test.go +++ b/middleware/compress_test.go @@ -35,8 +35,8 @@ func TestGzip(t *testing.T) { assert.Equal(t, gzipScheme, rec.Header().Get(echo.HeaderContentEncoding)) assert.Contains(t, rec.Header().Get(echo.HeaderContentType), echo.MIMETextPlain) r, err := gzip.NewReader(rec.Body) - defer r.Close() if assert.NoError(t, err) { + defer r.Close() buf := new(bytes.Buffer) buf.ReadFrom(r) assert.Equal(t, "test", buf.String())