Update go-chi dependency to v5

This commit is contained in:
Cameron Moore 2024-03-29 12:56:00 -05:00
parent dbc6565c35
commit 1d00387284
No known key found for this signature in database
GPG key ID: AF96E12468D7553E
55 changed files with 2126 additions and 966 deletions

17
vendor/github.com/go-chi/chi/v5/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, 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)
}
}