From c309c89db5aa15e1dad486c49ed4fd1babd23360 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Thu, 24 Jun 2021 10:44:39 -0700 Subject: [PATCH] reflect: document that InterfaceData is a low-entropy RNG Change-Id: Ie26b9060630e2e774ac23d8492eaaf785bfca6b7 Reviewed-on: https://go-review.googlesource.com/c/go/+/330709 Reviewed-by: Ian Lance Taylor Trust: Matthew Dempsky --- src/reflect/value.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/reflect/value.go b/src/reflect/value.go index 6ba6202a1a..9dce251ac5 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -1381,10 +1381,16 @@ func valueInterface(v Value, safe bool) interface{} { return packEface(v) } -// InterfaceData returns the interface v's value as a uintptr pair. +// InterfaceData returns a pair of unspecified uintptr values. // It panics if v's Kind is not Interface. +// +// In earlier versions of Go, this function returned the interface's +// value as a uintptr pair. As of Go 1.4, the implementation of +// interface values precludes any defined use of InterfaceData. +// +// Deprecated: The memory representation of interface values is not +// compatible with InterfaceData. func (v Value) InterfaceData() [2]uintptr { - // TODO: deprecate this v.mustBe(Interface) // We treat this as a read operation, so we allow // it even for unexported data, because the caller -- 2.50.0