fix use-errors-new from revive

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2025-05-15 11:56:40 +02:00
parent f0136d1dba
commit 381d9d0723
107 changed files with 267 additions and 235 deletions

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
@@ -38,7 +39,7 @@ func TestImageSearchWithUnauthorizedErrorAndPrivilegeFuncError(t *testing.T) {
client: newMockClient(errorMock(http.StatusUnauthorized, "Unauthorized error")),
}
privilegeFunc := func(_ context.Context) (string, error) {
return "", fmt.Errorf("Error requesting privilege")
return "", errors.New("Error requesting privilege")
}
_, err := client.ImageSearch(context.Background(), "some-image", registry.SearchOptions{
PrivilegeFunc: privilegeFunc,