Skip to content

Commit 72ffb01

Browse files
committed
Add a toLower function
1 parent 1c09c29 commit 72ffb01

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,11 @@ func constantsOfType(t *types.Type, pkg *apiPackage) []*types.Type {
648648
return sortTypes(constants)
649649
}
650650

651+
// toLower returns the lowercase version of the input string.
652+
func toLower(s string) string {
653+
return strings.ToLower(s)
654+
}
655+
651656
func render(w io.Writer, pkgs []*apiPackage, config generatorConfig) error {
652657
references := findTypeReferences(pkgs)
653658
typePkgMap := extractTypeToPackageMap(pkgs)
@@ -690,6 +695,7 @@ func render(w io.Writer, pkgs []*apiPackage, config generatorConfig) error {
690695
s = strings.ReplaceAll(s, "}}", "{ '}}' }")
691696
return s
692697
},
698+
"lower": toLower,
693699
}).ParseGlob(filepath.Join(*flTemplateDir, "*.tpl"))
694700
if err != nil {
695701
return errors.Wrap(err, "parse error")

0 commit comments

Comments
 (0)