Fix camel case fails if name starts with _

This commit is contained in:
Carlos Salguero 2014-09-01 12:41:39 -03:00
parent d12e84f264
commit f994d2f6cf
1 changed files with 1 additions and 1 deletions

View File

@ -886,7 +886,7 @@ func formatSourceCode(filename string) {
func camelCase(in string) string {
tokens := strings.Split(in, "_")
for i := range tokens {
tokens[i] = strings.ToUpper(tokens[i][:1]) + tokens[i][1:]
tokens[i] = strings.Title(strings.Trim(tokens[i], " "))
}
return strings.Join(tokens, "")
}