dnstap.TapperFromContext always returns nil (#2018)

Automatically submitted.
This commit is contained in:
varyoo 2018-08-02 00:58:23 +02:00 committed by corbot[bot]
parent 2b4878195c
commit 9cea32f013
2 changed files with 16 additions and 1 deletions

View 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")
}
}

View file

@ -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,