parent
23e9d4e5c0
commit
692d1b89fe
1
camel.go
1
camel.go
@ -31,6 +31,7 @@ import (
|
|||||||
|
|
||||||
// Converts a string to CamelCase
|
// Converts a string to CamelCase
|
||||||
func toCamelInitCase(s string, initCase bool) string {
|
func toCamelInitCase(s string, initCase bool) string {
|
||||||
|
s = strings.TrimSpace(s)
|
||||||
if s == "" {
|
if s == "" {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,8 @@ func toLowerCamel(tb testing.TB) {
|
|||||||
{"AnyKind of_string", "anyKindOfString"},
|
{"AnyKind of_string", "anyKindOfString"},
|
||||||
{"AnyKind.of-string", "anyKindOfString"},
|
{"AnyKind.of-string", "anyKindOfString"},
|
||||||
{"ID", "id"},
|
{"ID", "id"},
|
||||||
|
{"some string", "someString"},
|
||||||
|
{" some string", "someString"},
|
||||||
}
|
}
|
||||||
for _, i := range cases {
|
for _, i := range cases {
|
||||||
in := i[0]
|
in := i[0]
|
||||||
|
@ -54,6 +54,8 @@ func toSnake(tb testing.TB) {
|
|||||||
{"A1 A2 A3", "a_1_a_2_a_3"},
|
{"A1 A2 A3", "a_1_a_2_a_3"},
|
||||||
{"AB1AB2AB3", "ab_1_ab_2_ab_3"},
|
{"AB1AB2AB3", "ab_1_ab_2_ab_3"},
|
||||||
{"AB1 AB2 AB3", "ab_1_ab_2_ab_3"},
|
{"AB1 AB2 AB3", "ab_1_ab_2_ab_3"},
|
||||||
|
{"some string", "some_string"},
|
||||||
|
{" some string", "some_string"},
|
||||||
}
|
}
|
||||||
for _, i := range cases {
|
for _, i := range cases {
|
||||||
in := i[0]
|
in := i[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user