Skip to content

Commit

Permalink
Make schemafiles optional
Browse files Browse the repository at this point in the history
Signed-off-by: jawabuu <49921621+jawabuu@users.noreply.github.com>
  • Loading branch information
jawabuu committed Nov 10, 2020
1 parent 991e6e5 commit 0d95279
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/compose/vtcompose/vtcompose.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,14 @@ func parseKeyspaceInfo(keyspaceData string) map[string]keyspaceInfo {
tokens := strings.Split(v, ":")
shards, _ := strconv.Atoi(tokens[1])
replicaTablets, _ := strconv.Atoi(tokens[2])
schemaFileNames := strings.Split(tokens[3], ",")
schemaFileNames := []string{}
// Make schemafiles argument optional
if len(tokens) > 3 {
f := func(c rune) bool {
return c == ','
}
schemaFileNames = strings.FieldsFunc(tokens[3], f)
}

if len(tokens) > 4 {
keyspaceInfoMap[tokens[0]] = newKeyspaceInfo(tokens[0], shards, replicaTablets, schemaFileNames, tokens[4])
Expand Down

0 comments on commit 0d95279

Please sign in to comment.