diff options
author | 2019-09-05 21:39:32 -0700 | |
---|---|---|
committer | 2019-09-05 21:53:12 -0700 | |
commit | b94160df725a52af53f113bf27de7a7b8723174c (patch) | |
tree | 9e86b227d4683f26da9b393410df1bedc2e95074 /vendor/github.com/gorilla/mux/context.go | |
parent | 456ebaf423ce2122bf8faa36da464c5d90361204 (diff) |
Update dependencies
Diffstat (limited to 'vendor/github.com/gorilla/mux/context.go')
-rw-r--r-- | vendor/github.com/gorilla/mux/context.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vendor/github.com/gorilla/mux/context.go b/vendor/github.com/gorilla/mux/context.go new file mode 100644 index 0000000..665940a --- /dev/null +++ b/vendor/github.com/gorilla/mux/context.go @@ -0,0 +1,18 @@ +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)) +} |