diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-01 22:43:58 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-01 22:43:58 -0700 |
commit | d675f41242c043ddc4c6c1a1fb8aabcfd324aae2 (patch) | |
tree | 4f2afbce761eb377ad0b0ab2e4fb2f478ff844f5 /cmd/btrfs-rec/inspect_lstrees.go | |
parent | 9971e38110d5f90d15c7b78f396f2638b3952a96 (diff) | |
parent | 6e1a9fbb1e9a943e04902ed3a4958f6821e39456 (diff) |
Merge branch 'lukeshu/lint'
Diffstat (limited to 'cmd/btrfs-rec/inspect_lstrees.go')
-rw-r--r-- | cmd/btrfs-rec/inspect_lstrees.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/btrfs-rec/inspect_lstrees.go b/cmd/btrfs-rec/inspect_lstrees.go index e92c544..f74956a 100644 --- a/cmd/btrfs-rec/inspect_lstrees.go +++ b/cmd/btrfs-rec/inspect_lstrees.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com> +// Copyright (C) 2022-2023 Luke Shumaker <lukeshu@lukeshu.com> // // SPDX-License-Identifier: GPL-2.0-or-later @@ -54,13 +54,13 @@ func init() { } numWidth := len(strconv.Itoa(slices.Max(treeErrCnt, totalItems))) - table := tabwriter.NewWriter(os.Stdout, 0, 8, 2, ' ', 0) + table := tabwriter.NewWriter(os.Stdout, 0, 8, 2, ' ', 0) //nolint:gomnd // This is what looks Nice. textui.Fprintf(table, " errors\t% *s\n", numWidth, strconv.Itoa(treeErrCnt)) for _, typ := range maps.SortedKeys(treeItemCnt) { textui.Fprintf(table, " %v items\t% *s\n", typ, numWidth, strconv.Itoa(treeItemCnt[typ])) } textui.Fprintf(table, " total items\t% *s\n", numWidth, strconv.Itoa(totalItems)) - table.Flush() + _ = table.Flush() } visitedNodes := make(containers.Set[btrfsvol.LogicalAddr]) btrfsutil.WalkAllTrees(ctx, fs, btrfsutil.WalkAllTreesHandler{ @@ -79,12 +79,12 @@ func init() { }, Item: func(_ btrfstree.TreePath, item btrfstree.Item) error { typ := item.Key.ItemType - treeItemCnt[typ] = treeItemCnt[typ] + 1 + treeItemCnt[typ]++ return nil }, BadItem: func(_ btrfstree.TreePath, item btrfstree.Item) error { typ := item.Key.ItemType - treeItemCnt[typ] = treeItemCnt[typ] + 1 + treeItemCnt[typ]++ return nil }, }, @@ -113,7 +113,7 @@ func init() { } for _, item := range node.Data.BodyLeaf { typ := item.Key.ItemType - treeItemCnt[typ] = treeItemCnt[typ] + 1 + treeItemCnt[typ]++ } } } |