Skip to content

Commit

Permalink
Fix linter issues (docs) (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
elithrar committed May 1, 2018
1 parent b57cb16 commit ded0c29
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion middleware.go
Expand Up @@ -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)
}
Expand Down
9 changes: 6 additions & 3 deletions mux.go
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions route.go
Expand Up @@ -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
}
Expand Down

0 comments on commit ded0c29

Please sign in to comment.