@@ -83,7 +83,7 @@ func (c *Ctx) RequestStart(w http.ResponseWriter, r *http.Request) {
83
83
// golang.org/x/net/context contained on this Context.
84
84
// It is a shortcut for context.WithValue(..., ...)
85
85
func (c * Ctx ) Set (key interface {}, value interface {}) {
86
- * c .request = * c .request .WithContext (context .WithValue (c .request .Context (), key , value )) // temporarily shallow copying to avoid problems with external libraries
86
+ c .request = c .request .WithContext (context .WithValue (c .request .Context (), key , value )) // temporarily shallow copying to avoid problems with external libraries
87
87
}
88
88
89
89
// Get returns the value for the given key and is a shortcut
@@ -108,7 +108,7 @@ func (c *Ctx) Context() context.Context {
108
108
// WithContext updates the underlying request's context with to ctx
109
109
// The provided ctx must be non-nil.
110
110
func (c * Ctx ) WithContext (ctx context.Context ) {
111
- * c .request = * c .request .WithContext (ctx ) // temporarily shallow copying to avoid problems with external libraries
111
+ c .request = c .request .WithContext (ctx ) // temporarily shallow copying to avoid problems with external libraries
112
112
}
113
113
114
114
// Deadline calls the underlying golang.org/x/net/context Deadline()
@@ -135,29 +135,29 @@ func (c *Ctx) Value(key interface{}) interface{} {
135
135
// updates context on the containing las.Context object.
136
136
func (c * Ctx ) WithCancel () context.CancelFunc {
137
137
ctx , cf := context .WithCancel (c .request .Context ())
138
- * c .request = * c .request .WithContext (ctx ) // temporarily shallow copying to avoid problems with external libraries
138
+ c .request = c .request .WithContext (ctx ) // temporarily shallow copying to avoid problems with external libraries
139
139
return cf
140
140
}
141
141
142
142
// WithDeadline calls golang.org/x/net/context WithDeadline and automatically
143
143
// updates context on the containing las.Context object.
144
144
func (c * Ctx ) WithDeadline (deadline time.Time ) context.CancelFunc {
145
145
ctx , cf := context .WithDeadline (c .request .Context (), deadline )
146
- * c .request = * c .request .WithContext (ctx ) // temporarily shallow copying to avoid problems with external libraries
146
+ c .request = c .request .WithContext (ctx ) // temporarily shallow copying to avoid problems with external libraries
147
147
return cf
148
148
}
149
149
150
150
// WithTimeout calls golang.org/x/net/context WithTimeout and automatically
151
151
// updates context on the containing las.Context object.
152
152
func (c * Ctx ) WithTimeout (timeout time.Duration ) context.CancelFunc {
153
153
ctx , cf := context .WithTimeout (c .request .Context (), timeout )
154
- * c .request = * c .request .WithContext (ctx ) // temporarily shallow copying to avoid problems with external libraries
154
+ c .request = c .request .WithContext (ctx ) // temporarily shallow copying to avoid problems with external libraries
155
155
return cf
156
156
}
157
157
158
158
// WithValue calls golang.org/x/net/context WithValue and automatically
159
159
// updates context on the containing las.Context object.
160
160
// Can also use Set() function on Context object (Recommended)
161
161
func (c * Ctx ) WithValue (key interface {}, val interface {}) {
162
- * c .request = * c .request .WithContext (context .WithValue (c .request .Context (), key , val )) // temporarily shallow copying to avoid problems with external libraries
162
+ c .request = c .request .WithContext (context .WithValue (c .request .Context (), key , val )) // temporarily shallow copying to avoid problems with external libraries
163
163
}
0 commit comments