From 120e61e88bd2e0fd86185031b1ccf6643a73e4bd Mon Sep 17 00:00:00 2001 From: Matt Low Date: Thu, 22 Feb 2024 05:00:03 +0000 Subject: [PATCH] Fixed variable shadowing bug in ls command --- pkg/cli/cmd.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cli/cmd.go b/pkg/cli/cmd.go index 507da72..d628d0a 100644 --- a/pkg/cli/cmd.go +++ b/pkg/cli/cmd.go @@ -258,17 +258,17 @@ var listCmd = &cobra.Command{ var conversationsPrinted int outer: for _, category := range categories { - conversations, ok := categorized[category.name] + conversationLines, ok := categorized[category.name] if !ok { continue } - slices.SortFunc(conversations, func(a, b ConversationLine) int { + slices.SortFunc(conversationLines, func(a, b ConversationLine) int { return int(a.timeSinceReply - b.timeSinceReply) }) fmt.Printf("%s:\n", category.name) - for _, conv := range conversations { + for _, conv := range conversationLines { if conversationsPrinted >= LS_LIMIT && !all { fmt.Printf("%d remaining message(s), use --all to view.\n", len(conversations)-conversationsPrinted) break outer