Skip to content

Commit

Permalink
fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
willscott committed Jan 4, 2024
1 parent 434a856 commit 891f4cd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions helpers/memfs/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"os"
"path/filepath"
"strings"
"sync"
"time"
)
Expand Down Expand Up @@ -50,7 +51,9 @@ func (s *storage) New(path string, mode os.FileMode, flag int) (*file, error) {
}

s.files[path] = f
s.createParent(path, mode, f)
if err := s.createParent(path, mode, f); err != nil {
return nil, err
}
return f, nil
}

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

for pathFrom := range s.files {
if pathFrom == from || !filepath.HasPrefix(pathFrom, from) {
if pathFrom == from || !strings.HasPrefix(pathFrom, from) {
continue
}

Expand Down

0 comments on commit 891f4cd

Please sign in to comment.