From 7df2142389e94cbab3296158bd9ac590f1f5429c Mon Sep 17 00:00:00 2001 From: mehrdadbn9 Date: Sun, 22 Feb 2026 00:06:30 +0330 Subject: [PATCH] fix: use require for error assertions (testifylint) --- context_test.go | 2 +- utils_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/context_test.go b/context_test.go index 1f8bf52d..5df0be78 100644 --- a/context_test.go +++ b/context_test.go @@ -2954,7 +2954,7 @@ func TestContextGetRawDataNilBody(t *testing.T) { data, err := c.GetRawData() assert.Nil(t, data) - assert.Error(t, err) + require.Error(t, err) assert.Equal(t, "cannot read nil body", err.Error()) } diff --git a/utils_test.go b/utils_test.go index 24d1c4eb..e1f2c332 100644 --- a/utils_test.go +++ b/utils_test.go @@ -13,6 +13,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func init() { @@ -151,7 +152,7 @@ func TestMarshalXMLforHSuccess(t *testing.T) { "key2": 123, } data, err := xml.Marshal(h) - assert.NoError(t, err) + require.NoError(t, err) assert.Contains(t, string(data), "value1") assert.Contains(t, string(data), "123") }