func newKeyRange(value string) key.KeyRange { _, result, err := topo.ValidateShardName(value) if err != nil { panic(err) } return result }
// TabletKeyspaceShard is the option to set the tablet keyspace and shard func TabletKeyspaceShard(t *testing.T, keyspace, shard string) TabletOption { return func(tablet *topo.Tablet) { tablet.Keyspace = keyspace var err error tablet.Shard, tablet.KeyRange, err = topo.ValidateShardName(shard) if err != nil { t.Fatalf("cannot ValidateShardName value %v", shard) } } }