From 0c70e1919e7d0846a7eba6cf91e39e045f7fa91b Mon Sep 17 00:00:00 2001 From: uwaterloo gitlab Date: Sun, 24 Oct 2021 19:29:26 -0400 Subject: [PATCH] Replacing []byte{} with nil in some test cases Issue: https://github.com/valyala/fasthttp/issues/1132 --- header_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/header_test.go b/header_test.go index 46e603991a..bec631c3a2 100644 --- a/header_test.go +++ b/header_test.go @@ -61,13 +61,13 @@ func TestResponseHeaderMultiLineValue(t *testing.T) { t.Errorf("parse protocol with non-default value failed, got: %s want: HTTP/3.3", header.Protocol()) } - if !bytes.Equal(header.AppendStatusLine([]byte{}), []byte("HTTP/3.3 200 SuperOK\r\n")) { + if !bytes.Equal(header.AppendStatusLine(nil), []byte("HTTP/3.3 200 SuperOK\r\n")) { t.Errorf("parse status line with non-default value failed, got: %s want: HTTP/3.3 200 SuperOK", header.Protocol()) } header.SetStatusMessage(nil) - if !bytes.Equal(header.AppendStatusLine([]byte{}), []byte("HTTP/3.3 200 OK\r\n")) { + if !bytes.Equal(header.AppendStatusLine(nil), []byte("HTTP/3.3 200 OK\r\n")) { t.Errorf("parse status line with default protocol value failed, got: %s want: HTTP/3.3 200 OK", header.Protocol()) } @@ -106,7 +106,7 @@ func TestResponseHeaderMultiLineName(t *testing.T) { t.Errorf("expected default protocol, got: %s", header.Protocol()) } - if !bytes.Equal(header.AppendStatusLine([]byte{}), []byte("HTTP/1.1 200 OK\r\n")) { + if !bytes.Equal(header.AppendStatusLine(nil), []byte("HTTP/1.1 200 OK\r\n")) { t.Errorf("parse status line with non-default value failed, got: %s want: HTTP/1.1 200 OK", header.Protocol()) } }