1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-22 15:57:07 +00:00
restic/snapshot_windows.go
Alexander Neumann bb777d9a58 Introduce UserID, GroupID for snapshot
Use the fields UID and GID for Unix user and group ID, and the fields
UserID and GroupID for Windows user and group strings.
2015-02-03 22:04:09 +01:00

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
}