Skip to content

Commit 891f4cd

Browse files
committed
fix lint warnings
1 parent 434a856 commit 891f4cd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

helpers/memfs/storage.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"io"
77
"os"
88
"path/filepath"
9+
"strings"
910
"sync"
1011
"time"
1112
)
@@ -50,7 +51,9 @@ func (s *storage) New(path string, mode os.FileMode, flag int) (*file, error) {
5051
}
5152

5253
s.files[path] = f
53-
s.createParent(path, mode, f)
54+
if err := s.createParent(path, mode, f); err != nil {
55+
return nil, err
56+
}
5457
return f, nil
5558
}
5659

@@ -114,7 +117,7 @@ func (s *storage) Rename(from, to string) error {
114117
move := [][2]string{{from, to}}
115118

116119
for pathFrom := range s.files {
117-
if pathFrom == from || !filepath.HasPrefix(pathFrom, from) {
120+
if pathFrom == from || !strings.HasPrefix(pathFrom, from) {
118121
continue
119122
}
120123

0 commit comments

Comments
 (0)