From: Cuong Manh Le Date: Wed, 3 Aug 2022 03:36:35 +0000 (+0700) Subject: reflect: use doc links to refer to package "unsafe" X-Git-Tag: go1.20rc1~1794 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5405df09afff46d065da1d73d56347f7c859ab6f;p=gostls13.git reflect: use doc links to refer to package "unsafe" Change-Id: Ide465c4276424f2c437691d440dd100c4db2f091 Reviewed-on: https://go-review.googlesource.com/c/go/+/420974 Reviewed-by: Keith Randall Run-TryBot: Cuong Manh Le TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- diff --git a/src/reflect/value.go b/src/reflect/value.go index 74554a3ac8..969e57cf83 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -2030,9 +2030,9 @@ func (v Value) OverflowUint(x uint64) bool { // and make an exception. // Pointer returns v's value as a uintptr. -// It returns uintptr instead of unsafe.Pointer so that -// code using reflect cannot obtain unsafe.Pointers -// without importing the unsafe package explicitly. +// It returns uintptr instead of [unsafe.Pointer] so that +// code using reflect cannot obtain [unsafe.Pointer]s +// without importing the [unsafe] package explicitly. // It panics if v's Kind is not Chan, Func, Map, Pointer, Slice, or UnsafePointer. // // If v's Kind is Func, the returned pointer is an underlying @@ -2347,7 +2347,7 @@ func (v Value) SetUint(x uint64) { } } -// SetPointer sets the unsafe.Pointer value v to x. +// SetPointer sets the [unsafe.Pointer] value v to x. // It panics if v's Kind is not UnsafePointer. func (v Value) SetPointer(x unsafe.Pointer) { v.mustBeAssignable() @@ -2596,7 +2596,7 @@ func (v Value) Uint() uint64 { // and make an exception. // UnsafeAddr returns a pointer to v's data, as a uintptr. -// It is for advanced clients that also import the "unsafe" package. +// It is for advanced clients that also import the [unsafe] package. // It panics if v is not addressable. // // It's preferred to use uintptr(Value.Addr().UnsafePointer()) to get the equivalent result. @@ -2610,7 +2610,7 @@ func (v Value) UnsafeAddr() uintptr { return uintptr(v.ptr) } -// UnsafePointer returns v's value as a unsafe.Pointer. +// UnsafePointer returns v's value as a [unsafe.Pointer]. // It panics if v's Kind is not Chan, Func, Map, Pointer, Slice, or UnsafePointer. // // If v's Kind is Func, the returned pointer is an underlying