]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: correct documentation of Value.UnsafeAddr
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Sat, 18 Sep 2021 03:24:31 +0000 (10:24 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Mon, 18 Oct 2021 16:32:23 +0000 (16:32 +0000)
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 <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/reflect/value.go

index 449f3bbb3cd55a4430de72b9a676be1a0e18bb63..6bc02c1c8c2cd75507552d9cda3c1a44ad0d1262 100644 (file)
@@ -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 {