diff --git a/cmd/restic/integration_test.go b/cmd/restic/integration_test.go index 20e5e6402..f1b1ae7c6 100644 --- a/cmd/restic/integration_test.go +++ b/cmd/restic/integration_test.go @@ -1417,11 +1417,7 @@ func linksEqual(source, dest map[uint64][]string) bool { } } - if len(dest) != 0 { - return false - } - - return true + return len(dest) == 0 } func linkEqual(source, dest []string) bool { diff --git a/internal/archiver/archiver_test.go b/internal/archiver/archiver_test.go index d2e9c175b..3c4e3fdf6 100644 --- a/internal/archiver/archiver_test.go +++ b/internal/archiver/archiver_test.go @@ -1458,10 +1458,7 @@ func TestArchiverSnapshotSelect(t *testing.T) { "other": TestFile{Content: "another file"}, }, selFn: func(item string, fi os.FileInfo) bool { - if filepath.Ext(item) == ".txt" { - return false - } - return true + return filepath.Ext(item) != ".txt" }, }, { @@ -1485,10 +1482,7 @@ func TestArchiverSnapshotSelect(t *testing.T) { "other": TestFile{Content: "another file"}, }, selFn: func(item string, fi os.FileInfo) bool { - if filepath.Base(item) == "subdir" { - return false - } - return true + return filepath.Base(item) != "subdir" }, }, { diff --git a/internal/walker/walker.go b/internal/walker/walker.go index 1794e8a71..0146b0668 100644 --- a/internal/walker/walker.go +++ b/internal/walker/walker.go @@ -84,7 +84,7 @@ func walk(ctx context.Context, repo restic.TreeLoader, prefix string, parentTree return false, err } - if ignore == false { + if !ignore { allNodesIgnored = false }