Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
weak: don't panic when calling Value on a zero Pointer
Currently weak.Pointer.Value will panic if the weak.Pointer is uninitialized (zero value) which goes against it's documentation. Fix this and add a test. While we're here, also add a test to ensure weak.Make[T](nil) is equivalent to the zero value of weak.Pointer[T]. Fixes #71153. Change-Id: I4d9196026360bc42a5bfcb33ce449131ec251dba Reviewed-on: https://go-review.googlesource.com/c/go/+/641095 Reviewed-by: David Finkel <[email protected]> Auto-Submit: Michael Knyszek <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Carlos Amedee <[email protected]>
- Loading branch information