(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestContextWithLoggerAndLoggerFromContext(t *testing.T) { |
| 13 | log := New() |
| 14 | |
| 15 | ctx := ContextWithLogger(nil, log) |
| 16 | got, ok := LoggerFromContext(ctx) |
| 17 | |
| 18 | assert.True(t, ok) |
| 19 | assert.Same(t, log, got) |
| 20 | } |
| 21 | |
| 22 | func TestContextWithLogger_IgnoresNilLogger(t *testing.T) { |
| 23 | ctx := ContextWithLogger(context.Background(), nil) |
nothing calls this directly
no test coverage detected
searching dependent graphs…