Updated dependencies

This commit is contained in:
Stash Dev
2019-02-09 16:56:50 -08:00
parent 66e871a2d5
commit 4bbea0202e
299 changed files with 49759 additions and 15201 deletions

17
vendor/github.com/go-chi/chi/middleware/value.go generated vendored Normal file
View File

@@ -0,0 +1,17 @@
package middleware
import (
"context"
"net/http"
)
// WithValue is a middleware that sets a given key/value in a context chain.
func WithValue(key interface{}, val interface{}) func(next http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
r = r.WithContext(context.WithValue(r.Context(), key, val))
next.ServeHTTP(w, r)
}
return http.HandlerFunc(fn)
}
}