Skip to content

Commit

Permalink
Apply gofmt to all code
Browse files Browse the repository at this point in the history
  • Loading branch information
iancoleman committed Nov 29, 2017
1 parent 30c986a commit 3de563c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions camel.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func toCamelInitCase(s string, initCase bool) string {
n += string(v)
}
}
if v == '_' || v == ' ' || v == '-' {
if v == '_' || v == ' ' || v == '-' {
capNext = true
} else {
capNext = false
Expand All @@ -34,9 +34,9 @@ func toCamelInitCase(s string, initCase bool) string {
}

func ToCamel(s string) string {
return toCamelInitCase(s, true);
return toCamelInitCase(s, true)
}

func ToLowerCamel(s string) string {
return toCamelInitCase(s, false);
return toCamelInitCase(s, false)
}
20 changes: 10 additions & 10 deletions camel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (

func TestToCamel(t *testing.T) {
cases := [][]string{
[]string{ "test_case", "TestCase" },
[]string{ "test", "Test" },
[]string{ "TestCase", "TestCase" },
[]string{ " test case ", "TestCase" },
[]string{ "", "" },
[]string{ "many_many_words", "ManyManyWords" },
[]string{ "AnyKind of_string", "AnyKindOfString" },
[]string{ "odd-fix", "OddFix" },
[]string{ "numbers2And55with000", "Numbers2And55With000" },
[]string{"test_case", "TestCase"},
[]string{"test", "Test"},
[]string{"TestCase", "TestCase"},
[]string{" test case ", "TestCase"},
[]string{"", ""},
[]string{"many_many_words", "ManyManyWords"},
[]string{"AnyKind of_string", "AnyKindOfString"},
[]string{"odd-fix", "OddFix"},
[]string{"numbers2And55with000", "Numbers2And55With000"},
}
for _, i := range cases {
in := i[0]
Expand All @@ -28,7 +28,7 @@ func TestToCamel(t *testing.T) {

func TestToLowerCamel(t *testing.T) {
cases := [][]string{
[]string{ "foo-bar", "fooBar" },
[]string{"foo-bar", "fooBar"},
}
for _, i := range cases {
in := i[0]
Expand Down
28 changes: 14 additions & 14 deletions snake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ import (

func TestToSnake(t *testing.T) {
cases := [][]string{
[]string{ "testCase", "test_case" },
[]string{ "TestCase", "test_case" },
[]string{ "Test Case", "test_case" },
[]string{ " Test Case", "test_case" },
[]string{ "Test Case ", "test_case" },
[]string{ " Test Case ", "test_case" },
[]string{ "test", "test" },
[]string{ "test_case", "test_case" },
[]string{ "Test", "test" },
[]string{ "", "" },
[]string{ "ManyManyWords", "many_many_words" },
[]string{ "manyManyWords", "many_many_words" },
[]string{ "AnyKind of_string", "any_kind_of_string" },
[]string{ "numbers2and55with000", "numbers_2_and_55_with_000" },
[]string{"testCase", "test_case"},
[]string{"TestCase", "test_case"},
[]string{"Test Case", "test_case"},
[]string{" Test Case", "test_case"},
[]string{"Test Case ", "test_case"},
[]string{" Test Case ", "test_case"},
[]string{"test", "test"},
[]string{"test_case", "test_case"},
[]string{"Test", "test"},
[]string{"", ""},
[]string{"ManyManyWords", "many_many_words"},
[]string{"manyManyWords", "many_many_words"},
[]string{"AnyKind of_string", "any_kind_of_string"},
[]string{"numbers2and55with000", "numbers_2_and_55_with_000"},
}
for _, i := range cases {
in := i[0]
Expand Down

0 comments on commit 3de563c

Please sign in to comment.