Skip to content

Commit

Permalink
Use os.UserHomeDir instead of user.Current to avoid depedency to cgo (#…
Browse files Browse the repository at this point in the history
…119)

Co-authored-by: Loric Brevet <[email protected]>
  • Loading branch information
lobre and brevetlamersports authored Apr 23, 2022
1 parent 915aff0 commit beb3dcc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions request/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"
"io/ioutil"
"os"
"os/user"
"path/filepath"

"github.com/browserpass/browserpass-native/errors"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit beb3dcc

Please sign in to comment.