Browse Source

[docs] Improve docstrings for middleware, skipclean (#375)

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

2
middleware.go

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

2
mux.go

@ -13,7 +13,7 @@ import (
) )
var ( var (
// ErrMethodMismatch is returned when the error in the request does not match // ErrMethodMismatch is returned when the method in the request does not match
// the method defined against the route. // the method defined against the route.
ErrMethodMismatch = errors.New("method is not allowed") ErrMethodMismatch = errors.New("method is not allowed")
// ErrNotFound is returned when no route match is found. // ErrNotFound is returned when no route match is found.

4
route.go

@ -43,8 +43,8 @@ type Route struct {
buildVarsFunc BuildVarsFunc buildVarsFunc BuildVarsFunc
} }
// SkipClean bypasses cleaning the path, which includes removing duplicate // SkipClean reports whether path cleaning is enabled for this route via
// slashes and URL encoding. // Router.SkipClean.
func (r *Route) SkipClean() bool { func (r *Route) SkipClean() bool {
return r.skipClean return r.skipClean
} }

Loading…
Cancel
Save