Skip to content

Commit 1b98158

Browse files
Merge pull request #6 from enveritas/fix/struct-format
Fix/struct format
2 parents 5bd1108 + 95289ea commit 1b98158

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/gen.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ func methodName(name string) string {
219219
var pyIdentPattern = regexp.MustCompile("[^a-zA-Z0-9_]+")
220220

221221
func pyEnumValueName(value string) string {
222-
id := strings.Replace(value, "-", "_", -1)
223-
id = strings.Replace(id, ":", "_", -1)
224-
id = strings.Replace(id, "/", "_", -1)
222+
id := strings.ReplaceAll(value, "-", "_")
223+
id = strings.ReplaceAll(id, ":", "_")
224+
id = strings.ReplaceAll(id, "/", "_")
225225
id = pyIdentPattern.ReplaceAllString(id, "")
226226
return strings.ToUpper(id)
227227
}
@@ -406,7 +406,7 @@ func buildQueries(conf Config, req *plugin.GenerateRequest, structs []Struct) ([
406406
gq.Args = []QueryValue{{
407407
Emit: true,
408408
Name: "arg",
409-
Struct: columnsToStruct(req, query.Name+"Params", cols),
409+
Struct: columnsToStruct(req, modelName(query.Name+"Params", req.Settings), cols),
410410
}}
411411
} else {
412412
args := make([]QueryValue, 0, len(query.Params))
@@ -461,7 +461,7 @@ func buildQueries(conf Config, req *plugin.GenerateRequest, structs []Struct) ([
461461
Column: c,
462462
})
463463
}
464-
gs = columnsToStruct(req, query.Name+"Row", columns)
464+
gs = columnsToStruct(req, modelName(query.Name+"Row", req.Settings), columns)
465465
emit = true
466466
}
467467
gq.Ret = QueryValue{

0 commit comments

Comments
 (0)