From 86872dbb9e35c96fc5dad7b89af1f7069033e6c6 Mon Sep 17 00:00:00 2001 From: Arseny Balobanov Date: Fri, 6 May 2022 01:22:05 +0300 Subject: [PATCH] [gzep] Small test improvements. --- gzep/encode_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gzep/encode_test.go b/gzep/encode_test.go index d95b1af..b44638b 100644 --- a/gzep/encode_test.go +++ b/gzep/encode_test.go @@ -41,7 +41,8 @@ func TestEncode_RoundTrip(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { buf := new(bytes.Buffer) - require.NoError(t, gzep.Encode([]byte(tc.in), buf)) + err := gzep.Encode([]byte(tc.in), buf) + require.NoError(t, err) out, err := decode(buf) require.NoError(t, err, tc.in) @@ -74,7 +75,7 @@ func decode(r io.Reader) ([]byte, error) { } defer func() { _ = rr.Close() }() - buf := &bytes.Buffer{} + buf := new(bytes.Buffer) if _, err := io.Copy(buf, rr); err != nil { return nil, err }