]> Cypherpunks repositories - gostls13.git/commit
testing: fix panic in t.Log
authorJonathan Amsterdam <jba@google.com>
Thu, 15 May 2025 15:16:34 +0000 (11:16 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 15 May 2025 17:24:18 +0000 (10:24 -0700)
commit6df855ebac86499402cfd31d92256592c3b2a233
tree1746b8b719fdc83d334c93479daf6b4454688b18
parentfac2ccbed320ef9fdca251d63b759b61bbc21f2a
testing: fix panic in t.Log

If a testing.TB is no longer on the stack, t.Log would panic because
its outputWriter is nil. Check for nil and drop the write, which
is the previous behavior.

Change-Id: Ifde97997a3aa26ae604ac9c218588c1980110cbf
Reviewed-on: https://go-review.googlesource.com/c/go/+/673215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Jonathan Amsterdam <jba@google.com>
src/testing/sub_test.go
src/testing/testing.go