Fixes #69637.
Change-Id: Ie612b4df50f42f2786b22fb7a756949530f9178e
Reviewed-on: https://go-review.googlesource.com/c/go/+/616235
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
}
// Value returns a shallow copy of the T value that produced the Handle.
+// Value is safe for concurrent use by multiple goroutines.
func (h Handle[T]) Value() T {
return *h.value
}
// Make returns a globally unique handle for a value of type T. Handles
// are equal if and only if the values used to produce them are equal.
+// Make is safe for concurrent use by multiple goroutines.
func Make[T comparable](value T) Handle[T] {
// Find the map for type T.
typ := abi.TypeFor[T]()