TestSlogRemoteAddr tests that passing a nil net.Addr, as could be returned by conn.RemoteAddr(), does not cause a problem when passed to slog.F
(t *testing.T)
| 522 | // TestSlogRemoteAddr tests that passing a nil net.Addr, as could be returned by conn.RemoteAddr(), does not cause a |
| 523 | // problem when passed to slog.F |
| 524 | func TestSlogRemoteAddr(t *testing.T) { |
| 525 | t.Parallel() |
| 526 | logger := testutil.Logger(t) |
| 527 | var a net.Addr |
| 528 | logger.Info(context.Background(), "this should not segfault", slog.F("addr", a)) |
| 529 | } |