fix: enable err-error and errorf rules from perfsprint linter (#7859)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2024-12-10 08:03:43 +01:00
committed by GitHub
parent e8b31bf003
commit 156a2aa4c4
37 changed files with 102 additions and 69 deletions

View File

@@ -2,7 +2,7 @@ package parallel_test
import (
"context"
"fmt"
"errors"
"testing"
"github.com/stretchr/testify/assert"
@@ -78,7 +78,7 @@ func TestPipeline_Do(t *testing.T) {
3,
},
onItem: func(_ context.Context, _ int) (int, error) {
return 0, fmt.Errorf("error")
return 0, errors.New("error")
},
},
wantErr: require.Error,
@@ -92,7 +92,7 @@ func TestPipeline_Do(t *testing.T) {
2,
},
onItem: func(_ context.Context, _ int) (int, error) {
return 0, fmt.Errorf("error")
return 0, errors.New("error")
},
},
wantErr: require.Error,