stash/vendor/github.com/go-chi/chi/middleware/middleware.go

13 lines
384 B
Go
Raw Normal View History

2019-02-10 00:56:50 +00:00
package middleware
// contextKey is a value for use with context.WithValue. It's used as
// a pointer so it fits in an interface{} without allocation. This technique
// for defining context keys was copied from Go 1.7's new use of context in net/http.
type contextKey struct {
name string
}
func (k *contextKey) String() string {
return "chi/middleware context value " + k.name
}