@cryptotaxi247 / kubo / commits / 960996d16

simplify TildeExpansion()

Henry committed Oct 15, 2014 at 13:13 UTC 960996d16665522195244ac294abb4a481c83a91
1 file changed +1 -9
util/util.go
+1 -9
@@ -5,7 +5,6 @@ import (
5 "io"
6 "math/rand"
7 "path/filepath"
8 - "strings"
8 "time"
9
10 ds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
@@ -34,14 +33,7 @@ var ErrNotFound = ds.ErrNotFound
33
34 // TildeExpansion expands a filename, which may begin with a tilde.
35 func TildeExpansion(filename string) (string, error) {
37 - if strings.HasPrefix(filename, "~/") {
38 - var err error
39 - filename, err = homedir.Expand(filename)
40 - if err != nil {
41 - return "", err
42 - }
43 - }
44 - return filename, nil
36 + return homedir.Expand(filename)
37 }
38
39 // ExpandPathnames takes a set of paths and turns them into absolute paths