(t *testing.T)
| 41 | } |
| 42 | |
| 43 | func TestWithContext(t *testing.T) { |
| 44 | ctx := context.Background() |
| 45 | bag, ctx := ctxmeta.Inject(ctx) |
| 46 | bag.Set("foo", "bar") |
| 47 | |
| 48 | var buf bytes.Buffer |
| 49 | l := log.NewLogfmtLogger(&buf) |
| 50 | ll := WithContext(l, ctx) |
| 51 | ll.Log("baz", "qux") |
| 52 | assert.Contains(t, buf.String(), "foo=bar baz=qux") |
| 53 | } |
| 54 | |
| 55 | type mockSpan struct { |
| 56 | received []interface{} |
nothing calls this directly
no test coverage detected