From: Cuong Manh Le Date: Sat, 18 Sep 2021 03:24:31 +0000 (+0700) Subject: reflect: correct documentation of Value.UnsafeAddr X-Git-Tag: go1.18beta1~868 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=42515418a99f2540427a5d32189f6d44fb06939e;p=gostls13.git 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 --- 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 {