package lfo import ( "context" "net/http" core "nilfm.cc/git/nirvash/archetype" ) func WithAdapter(next http.Handler, adapter core.Adapter) http.Handler { handlerFunc := func(w http.ResponseWriter, req *http.Request) { *req = *req.WithContext(context.WithValue(req.Context(), "adapter", adapter)) next.ServeHTTP(w, req) } return http.HandlerFunc(handlerFunc) }