mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
dnstap.TapperFromContext always returns nil (#2018)
Automatically submitted.
This commit is contained in:
15
plugin/dnstap/context_test.go
Normal file
15
plugin/dnstap/context_test.go
Normal file
@@ -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")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,7 +51,7 @@ func TapperFromContext(ctx context.Context) (t Tapper) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TapMessage implements Tapper.
|
// TapMessage implements Tapper.
|
||||||
func (h *Dnstap) TapMessage(m *tap.Message) {
|
func (h Dnstap) TapMessage(m *tap.Message) {
|
||||||
t := tap.Dnstap_MESSAGE
|
t := tap.Dnstap_MESSAGE
|
||||||
h.IO.Dnstap(tap.Dnstap{
|
h.IO.Dnstap(tap.Dnstap{
|
||||||
Type: &t,
|
Type: &t,
|
||||||
|
|||||||
Reference in New Issue
Block a user