From cc94aa2dd980bea28a543ab8488013d4c991a58e Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Fri, 18 Jul 2014 01:34:29 +0200 Subject: [PATCH] Fixes pathFor() --- gin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gin.go b/gin.go index cbda6096..106e1b9c 100644 --- a/gin.go +++ b/gin.go @@ -144,7 +144,7 @@ func (group *RouterGroup) Group(component string, handlers ...HandlerFunc) *Rout func (group *RouterGroup) pathFor(p string) string { joined := path.Join(group.prefix, p) // Append a '/' if the last component had one, but only if it's not there already - if len(p) > 0 && p[len(p)-1] == '/' && joined[len(p)-1] != '/' { + if len(p) > 0 && p[len(p)-1] == '/' && joined[len(joined)-1] != '/' { return joined + "/" } return joined