Use context.Context

Rename the old Context to State and use context.Context in the
middleware for intra-middleware communication and more.
This commit is contained in:
Miek Gieben
2016-03-19 07:18:57 +00:00
parent 523cc0a0fd
commit f907311cdf
27 changed files with 358 additions and 919 deletions

View File

@@ -1,17 +1,9 @@
package log
import (
"bytes"
"log"
"net/http"
"net/http/httptest"
"strings"
"testing"
)
/*
type erroringMiddleware struct{}
func (erroringMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
func (erroringMiddleware) ServeDNS(w dns.ResponseWriter, r *dns.Msg) (int, error) {
return http.StatusNotFound, nil
}
@@ -46,3 +38,4 @@ func TestLoggedStatus(t *testing.T) {
t.Error("Expected 404 to be logged. Logged string -", logged)
}
}
*/