aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugin/dnstap/context_test.go15
-rw-r--r--plugin/dnstap/handler.go2
2 files changed, 16 insertions, 1 deletions
diff --git a/plugin/dnstap/context_test.go b/plugin/dnstap/context_test.go
new file mode 100644
index 000000000..04728e032
--- /dev/null
+++ b/plugin/dnstap/context_test.go
@@ -0,0 +1,15 @@
+package dnstap
+
+import (
+ "context"
+ "testing"
+)
+
+func TestDnstapContext(t *testing.T) {
+ ctx := tapContext{context.TODO(), Dnstap{}}
+ tapper := TapperFromContext(ctx)
+
+ if tapper == nil {
+ t.Fatal("Can't get tapper")
+ }
+}
diff --git a/plugin/dnstap/handler.go b/plugin/dnstap/handler.go
index 1c411e2aa..b09c70406 100644
--- a/plugin/dnstap/handler.go
+++ b/plugin/dnstap/handler.go
@@ -51,7 +51,7 @@ func TapperFromContext(ctx context.Context) (t Tapper) {
}
// TapMessage implements Tapper.
-func (h *Dnstap) TapMessage(m *tap.Message) {
+func (h Dnstap) TapMessage(m *tap.Message) {
t := tap.Dnstap_MESSAGE
h.IO.Dnstap(tap.Dnstap{
Type: &t,