From: Shenghou Ma Date: Mon, 5 Jan 2015 05:20:45 +0000 (-0500) Subject: reflect: document that Values can't be compared directly X-Git-Tag: go1.5beta1~2462 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a1c9e103719289b4f291fcb631ad324a0e331aed;p=gostls13.git reflect: document that Values can't be compared directly Fixes #9504. Change-Id: I148f407ace3d1b4db3f19fbb8561d1ee6c4c13b3 Reviewed-on: https://go-review.googlesource.com/2273 Reviewed-by: Rob Pike --- diff --git a/src/reflect/value.go b/src/reflect/value.go index 43843e963a..c34679d550 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -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