@@ -2,6 +2,8 @@ package config
22
33import (
44 "context"
5+ "errors"
6+ "fmt"
57 "io"
68 "os"
79 "path/filepath"
@@ -12,7 +14,6 @@ import (
1214 "github.com/docker/cli/internal/test"
1315 "github.com/docker/docker/api/types"
1416 "github.com/docker/docker/api/types/swarm"
15- "github.com/pkg/errors"
1617 "gotest.tools/v3/assert"
1718 is "gotest.tools/v3/assert/cmp"
1819 "gotest.tools/v3/golden"
@@ -37,7 +38,7 @@ func TestConfigCreateErrors(t *testing.T) {
3738 {
3839 args : []string {"name" , filepath .Join ("testdata" , configDataFile )},
3940 configCreateFunc : func (_ context.Context , configSpec swarm.ConfigSpec ) (types.ConfigCreateResponse , error ) {
40- return types.ConfigCreateResponse {}, errors .Errorf ("error creating config" )
41+ return types.ConfigCreateResponse {}, errors .New ("error creating config" )
4142 },
4243 expectedError : "error creating config" ,
4344 },
@@ -63,7 +64,7 @@ func TestConfigCreateWithName(t *testing.T) {
6364 cli := test .NewFakeCli (& fakeClient {
6465 configCreateFunc : func (_ context.Context , spec swarm.ConfigSpec ) (types.ConfigCreateResponse , error ) {
6566 if spec .Name != name {
66- return types.ConfigCreateResponse {}, errors .Errorf ("expected name %q, got %q" , name , spec .Name )
67+ return types.ConfigCreateResponse {}, fmt .Errorf ("expected name %q, got %q" , name , spec .Name )
6768 }
6869
6970 actual = spec .Data
@@ -102,7 +103,7 @@ func TestConfigCreateWithLabels(t *testing.T) {
102103 cli := test .NewFakeCli (& fakeClient {
103104 configCreateFunc : func (_ context.Context , spec swarm.ConfigSpec ) (types.ConfigCreateResponse , error ) {
104105 if ! reflect .DeepEqual (spec , expected ) {
105- return types.ConfigCreateResponse {}, errors .Errorf ("expected %+v, got %+v" , expected , spec )
106+ return types.ConfigCreateResponse {}, fmt .Errorf ("expected %+v, got %+v" , expected , spec )
106107 }
107108
108109 return types.ConfigCreateResponse {
@@ -128,11 +129,11 @@ func TestConfigCreateWithTemplatingDriver(t *testing.T) {
128129 cli := test .NewFakeCli (& fakeClient {
129130 configCreateFunc : func (_ context.Context , spec swarm.ConfigSpec ) (types.ConfigCreateResponse , error ) {
130131 if spec .Name != name {
131- return types.ConfigCreateResponse {}, errors .Errorf ("expected name %q, got %q" , name , spec .Name )
132+ return types.ConfigCreateResponse {}, fmt .Errorf ("expected name %q, got %q" , name , spec .Name )
132133 }
133134
134135 if spec .Templating .Name != expectedDriver .Name {
135- return types.ConfigCreateResponse {}, errors .Errorf ("expected driver %v, got %v" , expectedDriver , spec .Labels )
136+ return types.ConfigCreateResponse {}, fmt .Errorf ("expected driver %v, got %v" , expectedDriver , spec .Labels )
136137 }
137138
138139 return types.ConfigCreateResponse {
0 commit comments