Commit b55cbbb9 authored by Bryan C. Mills's avatar Bryan C. Mills Committed by Bryan Mills
Browse files

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: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
parent d198a36d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment