From 1544aacd8daf4edb6938638d85d43ef531319ad7 Mon Sep 17 00:00:00 2001 From: Michael Gasch Date: Tue, 22 Mar 2022 11:18:04 +0100 Subject: [PATCH] fix: Sharding example uses len(keys) Closes: #40 Signed-off-by: Michael Gasch --- sharded/example_sharder_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharded/example_sharder_test.go b/sharded/example_sharder_test.go index 4585f0b..1eb6717 100644 --- a/sharded/example_sharder_test.go +++ b/sharded/example_sharder_test.go @@ -17,7 +17,7 @@ func Example_sharder() { ks := sharded.NewKeySharder(keys) opts := []sharded.Option{ - sharded.WithNumShards(2), // must be >=len(keys) + sharded.WithNumShards(uint(len(keys))), // must be >=len(keys) sharded.WithSharder(ks), } l, err := sharded.New(ctx, opts...)