about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@lumberjaph.net>2013-04-28 13:34:22 -0700
committerFranck Cuny <franck@lumberjaph.net>2013-04-28 13:34:22 -0700
commit8a7ef03dad352157af8adec7364cb61758d24ab1 (patch)
treeecee67a7e8ae3effeef646c1ffd0db76012d2167
parentUpdate README with correct placeholders in URL. (diff)
downloadpath-router-8a7ef03dad352157af8adec7364cb61758d24ab1.tar.gz
Use `knownPaths` to return the list of paths in GetRouteList.
-rw-r--r--router.go8
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
 }