From beb3dcc81148d46184956e743f60864ac37e16f9 Mon Sep 17 00:00:00 2001 From: Loric Brevet Date: Sat, 23 Apr 2022 12:03:54 +0200 Subject: [PATCH] Use os.UserHomeDir instead of user.Current to avoid depedency to cgo (#119) Co-authored-by: Loric Brevet --- request/configure.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/request/configure.go b/request/configure.go index 148632c..897e03b 100644 --- a/request/configure.go +++ b/request/configure.go @@ -4,7 +4,6 @@ import ( "encoding/json" "io/ioutil" "os" - "os/user" "path/filepath" "github.com/browserpass/browserpass-native/errors" @@ -148,12 +147,12 @@ func getDefaultPasswordStorePath() (string, error) { return path, nil } - usr, err := user.Current() + home, err := os.UserHomeDir() if err != nil { return "", err } - path = filepath.Join(usr.HomeDir, ".password-store") + path = filepath.Join(home, ".password-store") return path, nil }