]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: document that Values can't be compared directly
authorShenghou Ma <minux@golang.org>
Mon, 5 Jan 2015 05:20:45 +0000 (00:20 -0500)
committerMinux Ma <minux@golang.org>
Mon, 5 Jan 2015 09:11:44 +0000 (09:11 +0000)
Fixes #9504.

Change-Id: I148f407ace3d1b4db3f19fbb8561d1ee6c4c13b3
Reviewed-on: https://go-review.googlesource.com/2273
Reviewed-by: Rob Pike <r@golang.org>
src/reflect/value.go

index 43843e963a4a73e52ffd51fc0948b40a3ca1756b..c34679d550ecd36cca58c9d3cf591c16fc6753c8 100644 (file)
@@ -30,6 +30,10 @@ const cannotSet = "cannot set value obtained from unexported struct field"
 // A Value can be used concurrently by multiple goroutines provided that
 // the underlying Go value can be used concurrently for the equivalent
 // 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.
 type Value struct {
        // typ holds the type of the value represented by a Value.
        typ *rtype