Skip to content

Commit

Permalink
Merge pull request #4 from lukesneeringer/fix-camel
Browse files Browse the repository at this point in the history
fix: Convert upper to lower camel case correctly.
  • Loading branch information
stoewer authored Nov 1, 2019
2 parents 9f4628d + bf17a8c commit 56c6d9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion camel.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func LowerCamelCase(s string) string {
}

func camelCase(s string, upper bool) string {
s = strings.TrimSpace(s)
s = strings.TrimSpace(SnakeCase(s))
buffer := make([]rune, 0, len(s))

var prev rune
Expand Down
2 changes: 2 additions & 0 deletions camel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func TestUpperCamelCase(t *testing.T) {
"": "",
"f": "F",
"foo": "Foo",
"fooBar": "FooBar",
" foo_bar\n": "FooBar",
" foo-bar\t": "FooBar",
" foo bar\r": "FooBar",
Expand All @@ -34,6 +35,7 @@ func TestLowerCamelCase(t *testing.T) {
"": "",
"F": "f",
"foo": "foo",
"FooBar": "fooBar",
" foo_bar\n": "fooBar",
" foo-bar\t": "fooBar",
" foo bar\r": "fooBar",
Expand Down

0 comments on commit 56c6d9c

Please sign in to comment.