From 4d14b01c84617b91273f1d9313bd433b0582b37b Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sat, 29 Jul 2017 10:48:27 +0100 Subject: [PATCH] More comments --- example.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/example.go b/example.go index 4bde260..9dda4a5 100644 --- a/example.go +++ b/example.go @@ -17,6 +17,9 @@ type Example struct { // ServeDNS implements the middleware.Handler interface. func (e Example) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) { + // Somewhat convoluted, as we could have printed "example" here and just call + // the next middleware - but as an example, show how to wrap a ResponseWriter might be + // educational. pw := NewResponsePrinter(w) return middleware.NextOrFailure(e.Name(), e.Next, ctx, pw, r) }