| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package backend | |
| 6 | |
| 7 import ( | |
| 8 "net/http" | |
| 9 | |
| 10 "github.com/julienschmidt/httprouter" | |
| 11 "github.com/luci/luci-go/server/middleware" | |
| 12 "golang.org/x/net/context" | |
| 13 ) | |
| 14 | |
| 15 // testBase is a middleware.Base which uses its current Context as the base | |
| 16 // context. | |
| 17 type testBase struct { | |
| 18 context.Context | |
| 19 } | |
| 20 | |
| 21 func (t *testBase) base(h middleware.Handler) httprouter.Handle { | |
| 22 return func(w http.ResponseWriter, r *http.Request, p httprouter.Params)
{ | |
| 23 h(t.Context, w, r, p) | |
| 24 } | |
| 25 } | |
| OLD | NEW |