2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-26 12:27:33 +00:00

Merge a few variable declaration and initializations

This commit is contained in:
Michael Eischer 2020-03-06 23:27:37 +01:00
parent 337725c354
commit 37113282ca
4 changed files with 5 additions and 11 deletions

View File

@ -251,9 +251,8 @@ func PrintSnapshots(stdout io.Writer, list restic.Snapshots, reasons []restic.Ke
// Prints nothing, if we did not group at all.
func PrintSnapshotGroupHeader(stdout io.Writer, groupKeyJSON string) error {
var key restic.SnapshotGroupKey
var err error
err = json.Unmarshal([]byte(groupKeyJSON), &key)
err := json.Unmarshal([]byte(groupKeyJSON), &key)
if err != nil {
return err
}

View File

@ -125,8 +125,7 @@ func (d *dir) Attr(ctx context.Context, a *fuse.Attr) error {
func (d *dir) calcNumberOfLinks() uint32 {
// a directory d has 2 hardlinks + the number
// of directories contained by d
var count uint32
count = 2
count := uint32(2)
for _, node := range d.items {
if node.Type == "dir" {
count++

View File

@ -15,15 +15,13 @@ func TestHardLinks(t *testing.T) {
idx.Add(1, 2, "inode1-file1-on-device2")
idx.Add(2, 3, "inode2-file2-on-device3")
var sresult string
sresult = idx.GetFilename(1, 2)
sresult := idx.GetFilename(1, 2)
rtest.Equals(t, sresult, "inode1-file1-on-device2")
sresult = idx.GetFilename(2, 3)
rtest.Equals(t, sresult, "inode2-file2-on-device3")
var bresult bool
bresult = idx.Has(1, 2)
bresult := idx.Has(1, 2)
rtest.Equals(t, bresult, true)
bresult = idx.Has(1, 3)

View File

@ -25,9 +25,7 @@ func GroupSnapshots(snapshots Snapshots, options string) (map[string]Snapshots,
var GroupByTag bool
var GroupByHost bool
var GroupByPath bool
var GroupOptionList []string
GroupOptionList = strings.Split(options, ",")
GroupOptionList := strings.Split(options, ",")
for _, option := range GroupOptionList {
switch option {