1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-09 03:09:50 +00:00
Files
steve/vendor/github.com/gorilla/mux/context.go
Darren Shepherd c0299c1506 Initial commit
2019-08-04 10:41:32 -07:00

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))
}