From 3578bb3287f4fd1bd92aa3135bc5554dfe866242 Mon Sep 17 00:00:00 2001 From: astaxie Date: Mon, 24 Jun 2013 17:28:15 +0800 Subject: [PATCH] fix bug substr --- utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.go b/utils.go index d1afd44f..8db8db4e 100644 --- a/utils.go +++ b/utils.go @@ -32,7 +32,7 @@ func Substr(s string, start, length int) string { } var end int if (start + length) > (len(bt) - 1) { - end = len(bt) - 1 + end = len(bt) } else { end = start + length }