testutils: fix testify usage (report by testifylint)

Use require.NoError(t, err) instead of require.Nil(t, err).
This commit is contained in:
Olivier Mengué 2024-03-11 21:55:12 +01:00
parent dd1b4c2e81
commit 294b497c0f
1 changed files with 3 additions and 3 deletions

View File

@ -7,9 +7,9 @@ import (
"strings" "strings"
"testing" "testing"
. "github.com/sirupsen/logrus"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
. "github.com/sirupsen/logrus"
) )
func LogAndAssertJSON(t *testing.T, log func(*Logger), assertions func(fields Fields)) { func LogAndAssertJSON(t *testing.T, log func(*Logger), assertions func(fields Fields)) {
@ -23,7 +23,7 @@ func LogAndAssertJSON(t *testing.T, log func(*Logger), assertions func(fields Fi
log(logger) log(logger)
err := json.Unmarshal(buffer.Bytes(), &fields) err := json.Unmarshal(buffer.Bytes(), &fields)
require.Nil(t, err) require.NoError(t, err)
assertions(fields) assertions(fields)
} }