util/util.go (raw)
1 2 3 4 5 6 7 8 9 10 |
package util import ( "context" "net/http" ) func AddContextValue(req *http.Request, key string, value interface{}) { *req = *req.WithContext(context.WithValue(req.Context(), key, value)) } |