Remove snapshot_darwin and snapshop_linux

This commit is contained in:
Florian Weingarten 2015-04-29 17:35:02 -04:00
parent 66b81a2a8b
commit f94d3d4b11
3 changed files with 24 additions and 56 deletions

View File

@ -3,7 +3,9 @@ package restic
import (
"fmt"
"os"
"os/user"
"path/filepath"
"strconv"
"time"
"github.com/restic/restic/backend"
@ -65,3 +67,25 @@ func (sn Snapshot) String() string {
func (sn Snapshot) ID() backend.ID {
return sn.id
}
func (sn *Snapshot) fillUserInfo() error {
usr, err := user.Current()
if err != nil {
return err
}
sn.Username = usr.Username
uid, err := strconv.ParseInt(usr.Uid, 10, 32)
if err != nil {
return err
}
sn.UID = uint32(uid)
gid, err := strconv.ParseInt(usr.Gid, 10, 32)
if err != nil {
return err
}
sn.GID = uint32(gid)
return nil
}

View File

@ -1,28 +0,0 @@
package restic
import (
"os/user"
"strconv"
)
func (sn *Snapshot) fillUserInfo() error {
usr, err := user.Current()
if err != nil {
return err
}
sn.Username = usr.Username
uid, err := strconv.ParseInt(usr.Uid, 10, 32)
if err != nil {
return err
}
sn.UID = uint32(uid)
gid, err := strconv.ParseInt(usr.Gid, 10, 32)
if err != nil {
return err
}
sn.GID = uint32(gid)
return nil
}

View File

@ -1,28 +0,0 @@
package restic
import (
"os/user"
"strconv"
)
func (sn *Snapshot) fillUserInfo() error {
usr, err := user.Current()
if err != nil {
return err
}
sn.Username = usr.Username
uid, err := strconv.ParseInt(usr.Uid, 10, 32)
if err != nil {
return err
}
sn.UID = uint32(uid)
gid, err := strconv.ParseInt(usr.Gid, 10, 32)
if err != nil {
return err
}
sn.GID = uint32(gid)
return nil
}