From f2ad438e9efb0b2c64d0e77ca2bf7ef0fc151988 Mon Sep 17 00:00:00 2001 From: bestplay <476128561@qq.com> Date: Fri, 27 Apr 2018 15:43:56 +0800 Subject: [PATCH] Update snake.go --- snake.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snake.go b/snake.go index d73cab1..e8bf881 100644 --- a/snake.go +++ b/snake.go @@ -13,7 +13,7 @@ func ToSnake(s string) string { for i, v := range s { // treat acronyms as words, eg for JSONData -> JSON is a whole word preIsCapital := false - if i - 1 > 0 { + if i > 0 { w := s[i-1] preIsCapital = w >= 'A' && w <= 'Z' }