diff --git a/pkg/backup/backup_shard.go b/pkg/backup/backup_shard.go index 9aca4fb4..6c99e48e 100644 --- a/pkg/backup/backup_shard.go +++ b/pkg/backup/backup_shard.go @@ -71,7 +71,7 @@ type shardFunc func(md *tableReplicaMetadata) (bool, error) func shardFuncByName(name string) (shardFunc, error) { chosen, ok := shardFuncRegistry[name] if !ok { - validOptions := make([]string, len(shardFuncRegistry)) + validOptions := make([]string, 0, len(shardFuncRegistry)) for k := range shardFuncRegistry { if k == "" { continue