From 0093943021d4d6ef88e57bb15c78558351f8a8cd Mon Sep 17 00:00:00 2001 From: gedi Date: Sat, 23 Sep 2017 17:34:19 +0300 Subject: [PATCH] closes #101 --- fmt.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fmt.go b/fmt.go index d694b25..f1241ec 100644 --- a/fmt.go +++ b/fmt.go @@ -406,9 +406,10 @@ func (f *basefmt) snippets() string { name = strings.TrimSpace(snippetMethodName.ReplaceAllString(name, "")) var words []string for i, w := range strings.Split(name, " ") { - if i != 0 { + switch { + case i != 0: w = strings.Title(w) - } else { + case len(w) > 0: w = string(unicode.ToLower(rune(w[0]))) + w[1:] } words = append(words, w)