Drop support for Go < 1.7: remove gorilla/context (#391)

* Drop support for Go < 1.7: remove gorilla/context
* Remove Go < 1.7 from Travis CI config
* Remove unneeded _native from context files
This commit is contained in:
Franklin Harding
2018-09-02 15:22:40 -07:00
committed by Matt Silverlock
parent 962c5bed07
commit 8771f97498
5 changed files with 0 additions and 72 deletions

22
context.go Normal file
View File

@@ -0,0 +1,22 @@
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
}