Fix typo in panic() message (extra single quote) (#1352)

Also fix the same typo in a comment
This commit is contained in:
Aurelien Regat-Barrel 2018-05-11 03:57:21 +02:00 committed by Bo-Yi Wu
parent bd4f73af67
commit 6e09ef03b0

View File

@ -232,7 +232,7 @@ func (n *node) addRoute(path string, handlers HandlersChain) {
} else if i == len(path) { // Make node a (in-path) leaf } else if i == len(path) { // Make node a (in-path) leaf
if n.handlers != nil { if n.handlers != nil {
panic("handlers are already registered for path ''" + fullPath + "'") panic("handlers are already registered for path '" + fullPath + "'")
} }
n.handlers = handlers n.handlers = handlers
} }
@ -247,7 +247,7 @@ func (n *node) addRoute(path string, handlers HandlersChain) {
func (n *node) insertChild(numParams uint8, path string, fullPath string, handlers HandlersChain) { func (n *node) insertChild(numParams uint8, path string, fullPath string, handlers HandlersChain) {
var offset int // already handled bytes of the path var offset int // already handled bytes of the path
// find prefix until first wildcard (beginning with ':'' or '*'') // find prefix until first wildcard (beginning with ':' or '*')
for i, max := 0, len(path); numParams > 0; i++ { for i, max := 0, len(path); numParams > 0; i++ {
c := path[i] c := path[i]
if c != ':' && c != '*' { if c != ':' && c != '*' {