Skip to content

Commit af67008

Browse files
committed
chore: use errors.New
1 parent be2e6c4 commit af67008

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

docker_mounts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package testcontainers
22

33
import (
4-
"fmt"
4+
"errors"
55
"path/filepath"
66

77
"github.com/docker/docker/api/types/mount"
@@ -112,7 +112,7 @@ type DockerImageMountSource struct {
112112
// Validate validates the source of the mount, ensuring that the subpath is a relative path
113113
func (s DockerImageMountSource) Validate() error {
114114
if !filepath.IsLocal(s.Subpath) {
115-
return fmt.Errorf("image mount source must be a local path")
115+
return errors.New("image mount source must be a local path")
116116
}
117117
return nil
118118
}

mounts.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package testcontainers
22

33
import (
44
"errors"
5-
"fmt"
65
"path/filepath"
76
)
87

@@ -180,7 +179,7 @@ func (GenericImageMountSource) Type() MountType {
180179
// Validate validates the source of the mount
181180
func (s GenericImageMountSource) Validate() error {
182181
if !filepath.IsLocal(s.Subpath) {
183-
return fmt.Errorf("image mount source must be a local path")
182+
return errors.New("image mount source must be a local path")
184183
}
185184
return nil
186185
}

0 commit comments

Comments
 (0)