Skip to content

Commit

Permalink
simplify TildeExpansion()
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptix committed Oct 15, 2014
1 parent 320ac33 commit 960996d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"io"
"math/rand"
"path/filepath"
"strings"
"time"

ds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/datastore.go"
Expand Down Expand Up @@ -34,14 +33,7 @@ var ErrNotFound = ds.ErrNotFound

// TildeExpansion expands a filename, which may begin with a tilde.
func TildeExpansion(filename string) (string, error) {
if strings.HasPrefix(filename, "~/") {
var err error
filename, err = homedir.Expand(filename)
if err != nil {
return "", err
}
}
return filename, nil
return homedir.Expand(filename)
}

// ExpandPathnames takes a set of paths and turns them into absolute paths
Expand Down

0 comments on commit 960996d

Please sign in to comment.