Browse code

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>

Sebastiaan van Stijn authored on 2025/12/18 23:29:35
Showing 1 changed files
... ...
@@ -2,6 +2,7 @@ package client
2 2
 
3 3
 import (
4 4
 	"encoding/json"
5
+	"errors"
5 6
 	"fmt"
6 7
 	"net/http"
7 8
 	"testing"
... ...
@@ -149,7 +150,7 @@ func TestExecStartConsoleSize(t *testing.T) {
149 149
 			client, err := New(
150 150
 				WithMockClient(func(req *http.Request) (*http.Response, error) {
151 151
 					if tc.expErr != "" {
152
-						return nil, fmt.Errorf("should not have made API request")
152
+						return nil, errors.New("should not have made API request")
153 153
 					}
154 154
 					if err := json.NewDecoder(req.Body).Decode(&actualReq); err != nil {
155 155
 						return nil, err