Skip to content

Commit b2423da

Browse files
srenatusachew22
authored andcommitted
runtime: use r.Context() (#473)
Signed-off-by: Stephan Renatus <[email protected]>
1 parent c323909 commit b2423da

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

runtime/mux.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ func (s *ServeMux) Handle(meth string, pat Pattern, h HandlerFunc) {
146146

147147
// ServeHTTP dispatches the request to the first handler whose pattern matches to r.Method and r.Path.
148148
func (s *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {
149-
// TODO: use r.Context for go 1.7+
150-
ctx := context.Background()
149+
ctx := r.Context()
151150

152151
path := r.URL.Path
153152
if !strings.HasPrefix(path, "/") {

0 commit comments

Comments
 (0)