Files
mattermost/vendor/github.com/gorilla/mux/context.go
Christopher Speller 41d117c37b MM-14617 Dependency upgrades and adding modules support. (#10517)
* Dependency upgrades and adding modules support.

* Commenting out file tests playload verification portion.

* Fixing viper.

* Fixing hclog.
2019-04-10 07:56:17 -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))
}