Skip to content

Commit

Permalink
group.go: sort topics before printing
Browse files Browse the repository at this point in the history
  • Loading branch information
m-wild committed Feb 18, 2024
1 parent 9ac8c1a commit 16f42ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/kaf/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,14 @@ var groupDescribeCmd = &cobra.Command{
errorExit("Failed to fetch group offsets: %v\n", err)
}

for topic, partitions := range offsetAndMetadata.Blocks {
topics := make([]string, 0, len(offsetAndMetadata.Blocks))
for k := range offsetAndMetadata.Blocks {
topics = append(topics, k)
}
sort.Strings(topics)

for _, topic := range topics {
partitions := offsetAndMetadata.Blocks[topic]
if len(flagDescribeTopics) > 0 {
var found bool
for _, topicToShow := range flagDescribeTopics {
Expand Down

0 comments on commit 16f42ec

Please # to comment.