Skip to content

Commit 6cdabf9

Browse files
lumtissoniasingla
authored andcommitted
fix: error when using a custom index for map that includes more than two word (ignite#1378)
1 parent 1933092 commit 6cdabf9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

integration/cmd_map_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func TestCreateMapWithStargate(t *testing.T) {
5959

6060
env.Must(env.Exec("create a map with custom indexes",
6161
step.NewSteps(step.New(
62-
step.Exec("starport", "s", "map", "map_with_index", "email", "--index", "foo:string,bar:int,foobar:uint,barfoo:bool"),
62+
step.Exec("starport", "s", "map", "map_with_index", "email", "--index", "foo:string,bar:int,foobar:uint,barFoo:bool"),
6363
step.Workdir(path),
6464
)),
6565
))

starport/templates/typed/indexed/stargate.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ import "%s/%s.proto";`
9494
)
9595
content := replacer.Replace(f.String(), typed.Placeholder, replacementImport)
9696

97-
var lowercaseIndexes []string
97+
var lowerCamelIndexes []string
9898
for _, index := range opts.Indexes {
99-
lowercaseIndexes = append(lowercaseIndexes, fmt.Sprintf("{%s}", index.Name.Lowercase))
99+
lowerCamelIndexes = append(lowerCamelIndexes, fmt.Sprintf("{%s}", index.Name.LowerCamel))
100100
}
101-
indexPath := strings.Join(lowercaseIndexes, "/")
101+
indexPath := strings.Join(lowerCamelIndexes, "/")
102102

103103
// Add the service
104104
templateService := `%[1]v

0 commit comments

Comments
 (0)