mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 16:56:47 +00:00
Refreshed / updated vendor dependencies Tested with "make". Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
19 lines
315 B
Go
19 lines
315 B
Go
package mux
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
)
|
|
|
|
func contextGet(r *http.Request, key interface{}) interface{} {
|
|
return r.Context().Value(key)
|
|
}
|
|
|
|
func contextSet(r *http.Request, key, val interface{}) *http.Request {
|
|
if val == nil {
|
|
return r
|
|
}
|
|
|
|
return r.WithContext(context.WithValue(r.Context(), key, val))
|
|
}
|