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>
This commit is contained in:
Sebastiaan van Stijn 2025-02-01 19:48:22 +01:00
parent c55b39a2e0
commit 4de5e92124
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 6 additions and 7 deletions

View File

@ -1,6 +1,7 @@
package environment
import (
"errors"
"fmt"
"os"
"strings"
@ -8,7 +9,6 @@ import (
"time"
"github.com/docker/docker/client"
"github.com/pkg/errors"
"gotest.tools/v3/icmd"
"gotest.tools/v3/poll"
"gotest.tools/v3/skip"

View File

@ -1,10 +1,9 @@
package output
import (
"fmt"
"strings"
"testing"
"github.com/pkg/errors"
)
// Assert checks output lines at specified locations
@ -30,7 +29,7 @@ func Prefix(expected string) func(string) error {
if strings.HasPrefix(actual, expected) {
return nil
}
return errors.Errorf("expected %q to start with %q", actual, expected)
return fmt.Errorf("expected %q to start with %q", actual, expected)
}
}
@ -40,7 +39,7 @@ func Suffix(expected string) func(string) error {
if strings.HasSuffix(actual, expected) {
return nil
}
return errors.Errorf("expected %q to end with %q", actual, expected)
return fmt.Errorf("expected %q to end with %q", actual, expected)
}
}
@ -50,7 +49,7 @@ func Contains(expected string) func(string) error {
if strings.Contains(actual, expected) {
return nil
}
return errors.Errorf("expected %q to contain %q", actual, expected)
return fmt.Errorf("expected %q to contain %q", actual, expected)
}
}
@ -60,6 +59,6 @@ func Equals(expected string) func(string) error {
if expected == actual {
return nil
}
return errors.Errorf("got %q, expected %q", actual, expected)
return fmt.Errorf("got %q, expected %q", actual, expected)
}
}