Skip to content

Commit 7ea7ef5

Browse files
committed
always override shard ids in shard manager config when using WithShardIDs
1 parent e9d502c commit 7ea7ef5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

sharding/shard_manager_config.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ func WithLogger(logger *slog.Logger) ConfigOpt {
6363
// WithShardIDs sets the shardIDs the ShardManager should manage.
6464
func WithShardIDs(shardIDs ...int) ConfigOpt {
6565
return func(config *config) {
66-
if config.ShardIDs == nil {
67-
config.ShardIDs = map[int]struct{}{}
68-
}
66+
config.ShardIDs = map[int]struct{}{}
6967
for _, shardID := range shardIDs {
7068
config.ShardIDs[shardID] = struct{}{}
7169
}

0 commit comments

Comments
 (0)