From 1d678dfdfa026968dbb19795c9bed16385603b21 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Mon, 16 Jul 2018 23:20:23 +0200 Subject: vendor dependencies with dep --- vendor/github.com/gorilla/mux/context_native.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 vendor/github.com/gorilla/mux/context_native.go (limited to 'vendor/github.com/gorilla/mux/context_native.go') diff --git a/vendor/github.com/gorilla/mux/context_native.go b/vendor/github.com/gorilla/mux/context_native.go new file mode 100644 index 00000000..209cbea7 --- /dev/null +++ b/vendor/github.com/gorilla/mux/context_native.go @@ -0,0 +1,24 @@ +// +build go1.7 + +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)) +} + +func contextClear(r *http.Request) { + return +} -- cgit