Browse Source

Fix linter issues (docs) (#370)

pull/371/head
Matt Silverlock 8 years ago committed by GitHub
parent
commit
ded0c29b24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      middleware.go
  2. 7
      mux.go
  3. 2
      route.go

2
middleware.go

@ -12,7 +12,7 @@ type middleware interface { @@ -12,7 +12,7 @@ type middleware interface {
Middleware(handler http.Handler) http.Handler
}
// MiddlewareFunc also implements the middleware interface.
// Middleware also implements the middleware interface.
func (mw MiddlewareFunc) Middleware(handler http.Handler) http.Handler {
return mw(handler)
}

7
mux.go

@ -13,7 +13,10 @@ import ( @@ -13,7 +13,10 @@ import (
)
var (
// ErrMethodMismatch is returned when the error in the request does not match
// the method defined against the route.
ErrMethodMismatch = errors.New("method is not allowed")
// ErrNotFound is returned when no route match is found.
ErrNotFound = errors.New("no matching route was found")
)
@ -95,9 +98,9 @@ func (r *Router) Match(req *http.Request, match *RouteMatch) bool { @@ -95,9 +98,9 @@ func (r *Router) Match(req *http.Request, match *RouteMatch) bool {
if r.MethodNotAllowedHandler != nil {
match.Handler = r.MethodNotAllowedHandler
return true
} else {
return false
}
return false
}
// Closest match for a router (includes sub-routers)

2
route.go

@ -43,6 +43,8 @@ type Route struct { @@ -43,6 +43,8 @@ type Route struct {
buildVarsFunc BuildVarsFunc
}
// SkipClean bypasses cleaning the path, which includes removing duplicate
// slashes and URL encoding.
func (r *Route) SkipClean() bool {
return r.skipClean
}

Loading…
Cancel
Save