From f20ad1118843f8dc75dcf8415e1d6d094f639d21 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Sat, 12 Nov 2016 14:54:41 +0200 Subject: [PATCH] Fix reserved name --- util.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util.go b/util.go index 175b175..234cf56 100644 --- a/util.go +++ b/util.go @@ -5,7 +5,7 @@ import ( "unicode/utf8" ) -func NormalizeString(s string, len int) string { +func NormalizeString(s string, length int) string { var ret string re, err := regexp.Compile("[^A-Za-z\\-0-9]+") if err != nil { @@ -13,8 +13,8 @@ func NormalizeString(s string, len int) string { return "" } ret = re.ReplaceAllString(s, "") - if utf8.RuneCountInString(ret) > len { - ret = ret[0:len] + if utf8.RuneCountInString(ret) > length { + ret = ret[0:length] } return ret }