Skip to content

Commit

Permalink
don't show key if it's empty/unset
Browse files Browse the repository at this point in the history
  • Loading branch information
birdayz committed Nov 19, 2018
1 parent 50383cd commit c0fc7e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/kaf/consume.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ var consumeCmd = &cobra.Command{
}

for msg := range pc.Messages() {
fmt.Printf("%v %v\n", string(msg.Key), string(msg.Value))
if msg.Key != nil && len(msg.Key) > 0 {
fmt.Printf("%v %v\n", string(msg.Key), string(msg.Value))
} else {
fmt.Printf("%v\n", string(msg.Value))
}
}
wg.Done()
}(partition)
Expand Down

0 comments on commit c0fc7e3

Please sign in to comment.