Skip to content

Commit

Permalink
use filepath, not path
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Jan 27, 2017
1 parent 448e897 commit 4b8d626
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions flatfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
"time"
Expand Down Expand Up @@ -118,13 +117,13 @@ func (fs *Datastore) ShardStr() string {

func (fs *Datastore) encode(key datastore.Key) (dir, file string) {
noslash := key.String()[1:]
dir = path.Join(fs.path, fs.getDir(noslash))
file = path.Join(dir, noslash+extension)
dir = filepath.Join(fs.path, fs.getDir(noslash))
file = filepath.Join(dir, noslash+extension)
return dir, file
}

func (fs *Datastore) decode(file string) (key datastore.Key, ok bool) {
if path.Ext(file) != extension {
if filepath.Ext(file) != extension {
return datastore.Key{}, false
}
name := file[:len(file)-len(extension)]
Expand Down

0 comments on commit 4b8d626

Please sign in to comment.