client: use errors.New (revive)

client/container_exec_test.go:152:19: use-errors-new: replace fmt.Errorf by errors.New (revive)
                            return nil, fmt.Errorf("should not have made API request")
                                        ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-12-18 15:29:35 +01:00
parent e254a9f0f1
commit 34ee29ceaa

View File

@@ -2,6 +2,7 @@ package client
import ( import (
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"net/http" "net/http"
"testing" "testing"
@@ -149,7 +150,7 @@ func TestExecStartConsoleSize(t *testing.T) {
client, err := New( client, err := New(
WithMockClient(func(req *http.Request) (*http.Response, error) { WithMockClient(func(req *http.Request) (*http.Response, error) {
if tc.expErr != "" { if tc.expErr != "" {
return nil, fmt.Errorf("should not have made API request") return nil, errors.New("should not have made API request")
} }
if err := json.NewDecoder(req.Body).Decode(&actualReq); err != nil { if err := json.NewDecoder(req.Body).Decode(&actualReq); err != nil {
return nil, err return nil, err