Commit 048b8cec authored by Joe Tsai's avatar Joe Tsai Committed by Joe Tsai

reflect: adjust documentation on Value

Make the documentation more explicit that it is not safe to directly
compare Value. Get straight to the point on how to do it correctly.

Updates #18871

Change-Id: I2aa3253f779636b2f72a1aae8c9bb45d3c32c902
Reviewed-on: https://go-review.googlesource.com/36018Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent 47ce8787
...@@ -30,9 +30,9 @@ const ptrSize = 4 << (^uintptr(0) >> 63) // unsafe.Sizeof(uintptr(0)) but an ide ...@@ -30,9 +30,9 @@ const ptrSize = 4 << (^uintptr(0) >> 63) // unsafe.Sizeof(uintptr(0)) but an ide
// the underlying Go value can be used concurrently for the equivalent // the underlying Go value can be used concurrently for the equivalent
// direct operations. // direct operations.
// //
// Using == on two Values does not compare the underlying values
// they represent, but rather the contents of the Value structs.
// To compare two Values, compare the results of the Interface method. // To compare two Values, compare the results of the Interface method.
// Using == on two Values does not compare the underlying values
// they represent.
type Value struct { type Value struct {
// typ holds the type of the value represented by a Value. // typ holds the type of the value represented by a Value.
typ *rtype typ *rtype
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment