diff --git a/README.md b/README.md index b867d06..2189f50 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ ## Name -*example* - prints "example" on every query received. +*example* - prints "example" on every query handled. ## Description -The example plugin prints "example" on every query received. It serves as documentation for -writing CoreDNS plugins. +The example plugin prints "example" on every query that go handled by the server. It serves as +documentation for writing CoreDNS plugins. ## Syntax diff --git a/example.go b/example.go index eefaa48..94a271b 100644 --- a/example.go +++ b/example.go @@ -61,12 +61,9 @@ func NewResponsePrinter(w dns.ResponseWriter) *ResponsePrinter { // WriteMsg calls the underlying ResponseWriter's WriteMsg method and prints "example" to standard output. func (r *ResponsePrinter) WriteMsg(res *dns.Msg) error { - fmt.Fprintln(out, ex) + fmt.Fprintln(out, "example") return r.ResponseWriter.WriteMsg(res) } // Make out a reference to os.Stdout so we can easily overwrite it for testing. var out io.Writer = os.Stdout - -// What we will print. -const ex = "example" diff --git a/example_test.go b/example_test.go index 9fa213e..93aade5 100644 --- a/example_test.go +++ b/example_test.go @@ -29,7 +29,7 @@ func TestExample(t *testing.T) { // Call our plugin directly, and check the result. x.ServeDNS(ctx, rec, r) - if a := b.String(); a != ex+"\n" { - t.Errorf("Failed to print '%s', got %s", ex, a) + if a := b.String(); a != "example\n" { + t.Errorf("Failed to print '%s', got %s", example, a) } }