Skip to content

Commit

Permalink
Merge pull request #305 from m-wild/master
Browse files Browse the repository at this point in the history
group.go: sort topics before printing
  • Loading branch information
birdayz committed Feb 19, 2024
2 parents 81417e7 + 16f42ec commit bb010cd
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 bb010cd

Please # to comment.