aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/binary/example_test.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2021-12-09 11:42:42 -0500
committerBryan Mills <bcmills@google.com>2021-12-13 16:42:23 +0000
commitb55cbbb9e76969d67fbc6e264a584ad18c2f95fa (patch)
treeed1663db1b43be6822ede330636b01b8da44c279 /src/encoding/binary/example_test.go
parentd198a36d8c1d0a251449a1cc2355485a177310c4 (diff)
downloadgo-b55cbbb9e76969d67fbc6e264a584ad18c2f95fa.tar.xz
net: pass a testing.TB to newLocal* helpers
Passing in an explicit testing.TB gives two benefits: 1. It allows the helper to fail the test itself, instead of returning an error to the caller. A non-nil error invariably fails the calling test, and none of these callers bother to add detail to the error when logging it anyway so returning the error just added noise to the test bodies. 2. It allows the helper to use t.Cleanup to perform any needed cleanup tasks, which will be used in CL 370695 to clean up temp directories used as namespaces for unix socket paths. For #34611 Change-Id: I805e701687c12de2caca955649369294229c10b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/370696 Trust: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/encoding/binary/example_test.go')
0 files changed, 0 insertions, 0 deletions