From 839d5c1aaae8f08d0df08f5e5a90f6145063616f Mon Sep 17 00:00:00 2001 From: ergastic <> Date: Wed, 18 Dec 2019 17:53:15 -0800 Subject: [PATCH] Fix build. --- filestore/filestore.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/filestore/filestore.go b/filestore/filestore.go index 1bd455b3..d6ad6a9a 100644 --- a/filestore/filestore.go +++ b/filestore/filestore.go @@ -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()) @@ -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) }