mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user