diff options
author | Franck Cuny <franck@lumberjaph.net> | 2013-04-28 13:34:22 -0700 |
---|---|---|
committer | Franck Cuny <franck@lumberjaph.net> | 2013-04-28 13:34:22 -0700 |
commit | 8a7ef03dad352157af8adec7364cb61758d24ab1 (patch) | |
tree | ecee67a7e8ae3effeef646c1ffd0db76012d2167 /router.go | |
parent | Update README with correct placeholders in URL. (diff) | |
download | path-router-8a7ef03dad352157af8adec7364cb61758d24ab1.tar.gz |
Use `knownPaths` to return the list of paths in GetRouteList.
Diffstat (limited to '')
-rw-r--r-- | router.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/router.go b/router.go index ce71df5..d5bcfd0 100644 --- a/router.go +++ b/router.go @@ -90,9 +90,11 @@ func (self *Router) disambiguateMatches(path string, matches []*Match) (*Match, } func (self *Router) GetRouteList() []string { - routes := make([]string, len(self.routes)) - for i, r := range self.routes{ - routes[i] = r.Path + routes := make([]string, len(self.knownPaths)) + i := 0 + for path, _ := range self.knownPaths { + routes[i] = path + i = i + 1 } return routes } |