countKeys counts unique keys from given Message slice.
(msgs []Message)
| 1921 | |
| 1922 | // countKeys counts unique keys from given Message slice. |
| 1923 | func countKeys(msgs []Message) int { |
| 1924 | m := make(map[string]struct{}) |
| 1925 | for _, msg := range msgs { |
| 1926 | m[string(msg.Key)] = struct{}{} |
| 1927 | } |
| 1928 | return len(m) |
| 1929 | } |
| 1930 | |
| 1931 | func createTopicWithCompaction(t *testing.T, topic string, partitions int) { |
| 1932 | t.Helper() |
no outgoing calls
no test coverage detected