MCPcopy
hub / github.com/segmentio/kafka-go / countKeys

Function countKeys

reader_test.go:1923–1929  ·  view source on GitHub ↗

countKeys counts unique keys from given Message slice.

(msgs []Message)

Source from the content-addressed store, hash-verified

1921
1922// countKeys counts unique keys from given Message slice.
1923func 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
1931func createTopicWithCompaction(t *testing.T, topic string, partitions int) {
1932 t.Helper()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected