about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@lumberjaph.net>2013-04-28 14:57:01 -0700
committerFranck Cuny <franck@lumberjaph.net>2013-04-28 14:57:01 -0700
commitbcad9eb7ee97d7d91fc2dab44bd3bff824f2e6e1 (patch)
tree5c106bf8695bfb0af1718f446e5de5130ffcc00d
parentAdd a method to get the HTTP methods supported for a path. (diff)
downloadpath-router-bcad9eb7ee97d7d91fc2dab44bd3bff824f2e6e1.tar.gz
`BuildRouter` return a reference to itself.
-rw-r--r--request_test.go2
-rw-r--r--router.go5
2 files changed, 4 insertions, 3 deletions
diff --git a/request_test.go b/request_test.go
index d59d9b8..d112087 100644
--- a/request_test.go
+++ b/request_test.go
@@ -12,7 +12,7 @@ func testRequestRoute(req *Request) (Response, error) {
 	return resp, nil
 }
 
-func buildRouter() Router {
+func buildRouter() *Router {
 	router := BuildRouter()
 	router.AddRoute(&Route{
 		Method: "GET",
diff --git a/router.go b/router.go
index 4c9dfab..d4c9058 100644
--- a/router.go
+++ b/router.go
@@ -10,12 +10,13 @@ import (
 type Router struct {
 	routes     []*Route
 	knownPaths map[string]map[string]bool
+	notAllowed bool
 }
 
-func BuildRouter() Router {
+func BuildRouter() *Router {
 	router := Router{}
 	router.knownPaths = map[string]map[string]bool{}
-	return router
+	return &router
 }
 
 func (self *Router) routeIsKnown(route *Route) bool {