Skip to content

Commit

Permalink
change variables name
Browse files Browse the repository at this point in the history
  • Loading branch information
coldstar committed Jun 28, 2017
1 parent 89eef17 commit 2d62c3c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ func (t *Tree) URLFor(name string, args ...interface{}) string {

// Routes returns registered route uri in a string slice
func (t *Tree) Routes() map[string][]string {
r := make(map[string][]string)
routes := make(map[string][]string)
for _, method := range RouterMethodName {
r[method] = make([]string, 0)
routes[method] = make([]string, 0)
}
for k := range t.nodes {
r[RouterMethodName[k]] = t.routes(t.nodes[k])
routes[RouterMethodName[k]] = t.routes(t.nodes[k])
}

return r
return routes
}

// routes print the route table
Expand Down Expand Up @@ -242,11 +242,11 @@ func (t *Tree) routes(l *leaf) []string {

// NamedRoutes returns named route uri in a string slice
func (t *Tree) NamedRoutes() map[string]string {
r := make(map[string]string)
routes := make(map[string]string)
for k, v := range t.nameNodes {
r[k] = v.pattern
routes[k] = v.pattern
}
return r
return routes
}

// Add registers a new handle with the given method, pattern and handlers.
Expand Down Expand Up @@ -503,7 +503,7 @@ func (l *leaf) hasPrefixString(s string) int {
return i
}

// String returns full pattern of leaf
// String returns pattern of leaf
func (l *leaf) String() string {
s := l.pattern
if l.kind == leafKindParam {
Expand Down

0 comments on commit 2d62c3c

Please sign in to comment.