Skip to content

Commit 4de5e92

Browse files
committed
internal/test: remove uses of pkg/errors in tests
While there may be reasons to keep pkg/errors in production code, we don't need them for these tests. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent c55b39a commit 4de5e92

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

internal/test/environment/testenv.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package environment
22

33
import (
4+
"errors"
45
"fmt"
56
"os"
67
"strings"
78
"testing"
89
"time"
910

1011
"github.com/docker/docker/client"
11-
"github.com/pkg/errors"
1212
"gotest.tools/v3/icmd"
1313
"gotest.tools/v3/poll"
1414
"gotest.tools/v3/skip"

internal/test/output/output.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package output
22

33
import (
4+
"fmt"
45
"strings"
56
"testing"
6-
7-
"github.com/pkg/errors"
87
)
98

109
// Assert checks output lines at specified locations
@@ -30,7 +29,7 @@ func Prefix(expected string) func(string) error {
3029
if strings.HasPrefix(actual, expected) {
3130
return nil
3231
}
33-
return errors.Errorf("expected %q to start with %q", actual, expected)
32+
return fmt.Errorf("expected %q to start with %q", actual, expected)
3433
}
3534
}
3635

@@ -40,7 +39,7 @@ func Suffix(expected string) func(string) error {
4039
if strings.HasSuffix(actual, expected) {
4140
return nil
4241
}
43-
return errors.Errorf("expected %q to end with %q", actual, expected)
42+
return fmt.Errorf("expected %q to end with %q", actual, expected)
4443
}
4544
}
4645

@@ -50,7 +49,7 @@ func Contains(expected string) func(string) error {
5049
if strings.Contains(actual, expected) {
5150
return nil
5251
}
53-
return errors.Errorf("expected %q to contain %q", actual, expected)
52+
return fmt.Errorf("expected %q to contain %q", actual, expected)
5453
}
5554
}
5655

@@ -60,6 +59,6 @@ func Equals(expected string) func(string) error {
6059
if expected == actual {
6160
return nil
6261
}
63-
return errors.Errorf("got %q, expected %q", actual, expected)
62+
return fmt.Errorf("got %q, expected %q", actual, expected)
6463
}
6564
}

0 commit comments

Comments
 (0)