From 42515418a99f2540427a5d32189f6d44fb06939e Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Sat, 18 Sep 2021 10:24:31 +0700 Subject: [PATCH] reflect: correct documentation of Value.UnsafeAddr The doc mentions that "UnsafeAddr returns a _pointer_ to v's data", but it returns a uintptr instead, which don't have pointer semantic. Change-Id: I557d5597cbc485356ca803eb496a99d6db8c63ba Reviewed-on: https://go-review.googlesource.com/c/go/+/350690 Trust: Cuong Manh Le Run-TryBot: Cuong Manh Le TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor Reviewed-by: Matthew Dempsky --- src/reflect/value.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reflect/value.go b/src/reflect/value.go index 449f3bbb3c..6bc02c1c8c 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -2473,7 +2473,7 @@ func (v Value) Uint() uint64 { // which ensures cmd/compile can recognize unsafe.Pointer(v.UnsafeAddr()) // and make an exception. -// UnsafeAddr returns a pointer to v's data. +// UnsafeAddr returns a pointer to v's data, as a uintptr. // It is for advanced clients that also import the "unsafe" package. // It panics if v is not addressable. func (v Value) UnsafeAddr() uintptr { -- 2.50.0