Skip to content

Commit

Permalink
Fix build.
Browse files Browse the repository at this point in the history
  • Loading branch information
ergastic committed Dec 19, 2019
1 parent 6c15861 commit 839d5c1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions filestore/filestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ type fileStore struct {

// NewLocalFileStore creates a filestore mounted on a given local directory path
func NewLocalFileStore(basedirectory Path) (FileStore, error) {
i := len(basedirectory) - 1
for ; i >= 0; i-- {
if basedirectory[i] != os.PathSeparator {
break
}
}
base := basedirectory[0 : i+1]
base := filepath.Clean(string(basedirectory))
info, err := os.Stat(string(base))
if err != nil {
return nil, fmt.Errorf("error getting %s info: %s", base, err.Error())
Expand Down Expand Up @@ -67,7 +61,7 @@ func (fs fileStore) Store(p Path, src File) (Path, error) {
}

func (fs fileStore) Delete(p Path) error {
for idx, _ := range fs.base {
for idx := range fs.base {
if p[idx] != fs.base[idx] {
return fmt.Errorf("invalid base path for '%s' (expecting '%s')", string(p), fs.base)
}
Expand Down

0 comments on commit 839d5c1

Please sign in to comment.