forked from TrueCloudLab/restic
bb777d9a58
Use the fields UID and GID for Unix user and group ID, and the fields UserID and GroupID for Windows user and group strings.
16 lines
225 B
Go
16 lines
225 B
Go
package restic
|
|
|
|
import "os/user"
|
|
|
|
func (sn *Snapshot) fillUserInfo() error {
|
|
usr, err := user.Current()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
sn.Username = usr.Username
|
|
sn.UserID = usr.Uid
|
|
sn.GroupID = usr.Gid
|
|
|
|
return nil
|
|
}
|