From 986be5870290a73777f015e84709abbbb1f7ff8b Mon Sep 17 00:00:00 2001 From: BenLampson <58603432@qq.com> Date: Wed, 25 Sep 2019 16:11:39 +0800 Subject: [PATCH] Fix bug:about the MVC package route binding I found there has some little bug in the controller_method_parser.go the bug is : if someone use the code like this: func (cc *HelloWorld) GetInfoXYT() We can't create the Url that he want. We lose the T, our's url is: info/x/y Cause// it doesn't count the last uppercase and the last append is words = append(words, s[start:end]) Former-commit-id: 9ff6ad4a220aea2730243ba44912d5a6acc66266 --- mvc/controller_method_parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mvc/controller_method_parser.go b/mvc/controller_method_parser.go index 650a880a..aef3062f 100644 --- a/mvc/controller_method_parser.go +++ b/mvc/controller_method_parser.go @@ -51,7 +51,7 @@ func (l *methodLexer) reset(s string) { } if end > 0 && len(s) >= end { - words = append(words, s[start:end]) + words = append(words, s[start:]) } }