Skip to content

Commit 4251541

Browse files
committed
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 <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
1 parent 417100e commit 4251541

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/reflect/value.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2473,7 +2473,7 @@ func (v Value) Uint() uint64 {
24732473
// which ensures cmd/compile can recognize unsafe.Pointer(v.UnsafeAddr())
24742474
// and make an exception.
24752475

2476-
// UnsafeAddr returns a pointer to v's data.
2476+
// UnsafeAddr returns a pointer to v's data, as a uintptr.
24772477
// It is for advanced clients that also import the "unsafe" package.
24782478
// It panics if v is not addressable.
24792479
func (v Value) UnsafeAddr() uintptr {

0 commit comments

Comments
 (0)