Skip to content

Commit 048b8ce

Browse files
committed
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/36018 Reviewed-by: Keith Randall <[email protected]>
1 parent 47ce878 commit 048b8ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/reflect/value.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ const ptrSize = 4 << (^uintptr(0) >> 63) // unsafe.Sizeof(uintptr(0)) but an ide
3030
// the underlying Go value can be used concurrently for the equivalent
3131
// direct operations.
3232
//
33-
// Using == on two Values does not compare the underlying values
34-
// they represent, but rather the contents of the Value structs.
3533
// To compare two Values, compare the results of the Interface method.
34+
// Using == on two Values does not compare the underlying values
35+
// they represent.
3636
type Value struct {
3737
// typ holds the type of the value represented by a Value.
3838
typ *rtype

0 commit comments

Comments
 (0)