diff options
author | Moritz Poldrack <git@moritz.sh> | 2022-07-29 22:31:54 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-08-04 21:57:57 +0200 |
commit | 5ca6022d007bc83daba1e7297480d37f56554455 (patch) | |
tree | cc592d08276b7f0c8db6a4280bb7fb648b2548fe /widgets/dirtree.go | |
parent | a8d631177f4315810f0ab7c7d66d38e332ab0916 (diff) | |
download | aerc-5ca6022d007bc83daba1e7297480d37f56554455.tar.gz |
lint: ensure errors are at least logged (errcheck)
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets/dirtree.go')
-rw-r--r-- | widgets/dirtree.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/widgets/dirtree.go b/widgets/dirtree.go index 7b10f02e..94868526 100644 --- a/widgets/dirtree.go +++ b/widgets/dirtree.go @@ -8,6 +8,7 @@ import ( "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib/ui" + "git.sr.ht/~rjarry/aerc/logging" "git.sr.ht/~rjarry/aerc/worker/types" "github.com/gdamore/tcell/v2" ) @@ -363,10 +364,13 @@ func (dt *DirectoryTree) buildTree() { dt.list = make([]*types.Thread, 0) for _, node := range threads { - node.Walk(func(t *types.Thread, lvl int, err error) error { + err := node.Walk(func(t *types.Thread, lvl int, err error) error { dt.list = append(dt.list, t) return nil }) + if err != nil { + logging.Warnf("failed to walk tree: %v", err) + } } } @@ -420,12 +424,15 @@ func isVisible(node *types.Thread) bool { } func getAnyUid(node *types.Thread) (uid uint32) { - node.Walk(func(t *types.Thread, l int, err error) error { + err := node.Walk(func(t *types.Thread, l int, err error) error { if t.FirstChild == nil { uid = t.Uid } return nil }) + if err != nil { + logging.Warnf("failed to get uid: %v", err) + } return } |