Replace user.Home() with os.HomeDir() to remove CGo dependency (hopefully)
This commit is contained in:
parent
65b77f33cc
commit
d2d9418b8b
|
@ -8,7 +8,6 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"os/user"
|
||||
"regexp"
|
||||
|
||||
"crypto/rand"
|
||||
|
@ -604,15 +603,15 @@ func pickFile(args []string, filters *filters, sort string, cache *fileCache, fo
|
|||
}
|
||||
|
||||
func normalizePath(path string) (string, error) {
|
||||
usr, err := user.Current()
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if path == "~" {
|
||||
path = usr.HomeDir
|
||||
path = homeDir
|
||||
} else if strings.HasPrefix(path, "~/") {
|
||||
path = filepath.Join(usr.HomeDir, path[2:])
|
||||
path = filepath.Join(homeDir, path[2:])
|
||||
}
|
||||
|
||||
path, err = filepath.EvalSymlinks(path)
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
ReleaseVersion string = "0.78.1"
|
||||
ReleaseVersion string = "0.78.2"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
Loading…
Reference in New Issue