From 028cc9b7bb28c6fff2b8ec07d002875801413f4e Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Sun, 22 Sep 2024 22:11:49 +0200 Subject: [PATCH] [chore]: enable error-is-as rule from testifylint Signed-off-by: Matthieu MOREL --- .golangci.yml | 1 - samplers/probability/consistent/tracestate_test.go | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 8e9802c9284..f56613831e1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -248,7 +248,6 @@ linters-settings: enable-all: true disable: - compares - - error-is-as - expected-actual - float-compare - formatter diff --git a/samplers/probability/consistent/tracestate_test.go b/samplers/probability/consistent/tracestate_test.go index e11db24f8ac..fb2c8314ddc 100644 --- a/samplers/probability/consistent/tracestate_test.go +++ b/samplers/probability/consistent/tracestate_test.go @@ -4,7 +4,6 @@ package consistent import ( - "errors" "strconv" "strings" "testing" @@ -91,7 +90,7 @@ func TestParseTraceStateUnsampled(t *testing.T) { require.False(t, otts.hasPValue(), "should have no p-value") if test.expectErr != nil { - require.True(t, errors.Is(err, test.expectErr), "not expecting %v", err) + require.ErrorIs(t, err, test.expectErr, "not expecting %v", err) } if test.rval != notset { require.True(t, otts.hasRValue()) @@ -168,7 +167,7 @@ func TestParseTraceStateSampled(t *testing.T) { otts, err := parseOTelTraceState(test.in, true) if test.expectErr != nil { - require.True(t, errors.Is(err, test.expectErr), "not expecting %v", err) + require.ErrorIs(t, err, test.expectErr, "not expecting %v", err) } else { require.NoError(t, err) } @@ -252,7 +251,7 @@ func TestParseTraceStateExtra(t *testing.T) { otts, err := parseOTelTraceState(test.in, test.sampled) if test.expectErr != nil { - require.True(t, errors.Is(err, test.expectErr), "not expecting %v", err) + require.ErrorIs(t, err, test.expectErr, "not expecting %v", err) } else { require.NoError(t, err) }