Fix linter issues (docs) (#370)

This commit is contained in:
Matt Silverlock
2018-04-30 20:11:36 -07:00
committed by GitHub
parent b57cb1605f
commit ded0c29b24
3 changed files with 9 additions and 4 deletions

View File

@@ -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)
}

9
mux.go
View File

@@ -13,8 +13,11 @@ 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 = errors.New("no matching route was found")
// ErrNotFound is returned when no route match is found.
ErrNotFound = errors.New("no matching route was found")
)
// NewRouter returns a new router instance.
@@ -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)

View File

@@ -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
}