summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gorilla/mux/context_gorilla.go
blob: d7adaa8fad4fa8ce62d18a7058d10723ff2288af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// +build !go1.7

package mux

import (
	"net/http"

	"github.com/gorilla/context"
)

func contextGet(r *http.Request, key interface{}) interface{} {
	return context.Get(r, key)
}

func contextSet(r *http.Request, key, val interface{}) *http.Request {
	if val == nil {
		return r
	}

	context.Set(r, key, val)
	return r
}

func contextClear(r *http.Request) {
	context.Clear(r)
}