From a1c9e103719289b4f291fcb631ad324a0e331aed Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Mon, 5 Jan 2015 00:20:45 -0500 Subject: [PATCH] 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 --- src/reflect/value.go | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.50.0