Skip to content

Commit 20dc4e4

Browse files
committed
bug fix UTF-8 refactor: simplify capitalizeFirstRune using unicode.ToUpper. Replace strings.ToUpper roundtrip with direct unicode.ToUpper call for cleaner single-rune capitalization.
1 parent 039b995 commit 20dc4e4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mdl/executor/cmd_jsonstructures.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"io"
99
"strings"
10+
"unicode"
1011

1112
"github.com/mendixlabs/mxcli/mdl/ast"
1213
"github.com/mendixlabs/mxcli/sdk/mpr"
@@ -184,7 +185,7 @@ func capitalizeFirstRune(s string) string {
184185
return s
185186
}
186187
runes := []rune(s)
187-
runes[0] = rune(strings.ToUpper(string(runes[0]))[0])
188+
runes[0] = unicode.ToUpper(runes[0])
188189
return string(runes)
189190
}
190191

0 commit comments

Comments
 (0)