From f94d3d4b11e5196315a67d475d82fed8c9068e1f Mon Sep 17 00:00:00 2001 From: Florian Weingarten Date: Wed, 29 Apr 2015 17:35:02 -0400 Subject: [PATCH] Remove snapshot_darwin and snapshop_linux --- snapshot.go | 24 ++++++++++++++++++++++++ snapshot_darwin.go | 28 ---------------------------- snapshot_linux.go | 28 ---------------------------- 3 files changed, 24 insertions(+), 56 deletions(-) delete mode 100644 snapshot_darwin.go delete mode 100644 snapshot_linux.go diff --git a/snapshot.go b/snapshot.go index eaaf94ec4..a582d99a0 100644 --- a/snapshot.go +++ b/snapshot.go @@ -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 +} diff --git a/snapshot_darwin.go b/snapshot_darwin.go deleted file mode 100644 index ae1eaa3b9..000000000 --- a/snapshot_darwin.go +++ /dev/null @@ -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 -} diff --git a/snapshot_linux.go b/snapshot_linux.go deleted file mode 100644 index ae1eaa3b9..000000000 --- a/snapshot_linux.go +++ /dev/null @@ -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 -}