Merge a few variable declaration and initializations

This commit is contained in:
Michael Eischer committed 2020-09-05 10:05:34 +02:00
1 parent 337725c354
commit 37113282ca
4 files changed
+5 -11

No files matched your search

+1 -2
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++
+2 -4
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)
+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 {