소스 검색

More comments

Miek Gieben 7 년 전
부모
커밋
4d14b01c84
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      example.go

+ 3 - 0
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)
 }