Mercurial > go > multipass
diff file/file.go @ 13:da6c493cf08a
Move Unix-specific user auth files into unix_users.go.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Thu, 29 Oct 2015 21:29:27 -0400 |
parents | 1246b4b9028b |
children | 9b4ec6b5c23e |
line wrap: on
line diff
--- a/file/file.go Thu Oct 29 21:25:12 2015 -0400 +++ b/file/file.go Thu Oct 29 21:29:27 2015 -0400 @@ -10,8 +10,6 @@ "bufio" "errors" "os" - "os/user" - "path" "syscall" "time" @@ -33,24 +31,6 @@ name string } -// ForUser gets the given user's ShadowFile. -func ForUser(username string) (*ShadowFile, error) { - u, err := user.Lookup(username) - if err != nil { - return nil, err - } - return New(path.Join(u.HomeDir, MultipassFile)), nil -} - -// ForMe gets the current user's ShadowFile. -func ForMe() (*ShadowFile, error) { - u, err := user.Current() - if err != nil { - return nil, err - } - return New(path.Join(u.HomeDir, MultipassFile)), nil -} - // New creates a ShadowFile for reading at the given path. // If a file needs to be created, uses the given GID to create it. func New(name string) *ShadowFile {