]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: undeprecate Value.{Pointer,UnsafeAddr}
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Wed, 27 Oct 2021 17:33:19 +0000 (00:33 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 28 Oct 2021 02:35:22 +0000 (02:35 +0000)
Fixes #49187

Change-Id: I4d8c87af8a709f1b909dd4fae3734d422eb36900
Reviewed-on: https://go-review.googlesource.com/c/go/+/359194
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>
src/reflect/value.go

index 5d9964eb9d5c3b10f80d40f2adab477b0fd7cdfb..618d38893e8456744dfd7f7ef12ec721a395f984 100644 (file)
@@ -1934,7 +1934,7 @@ func (v Value) OverflowUint(x uint64) bool {
 // element of the slice. If the slice is nil the returned value
 // is 0.  If the slice is empty but non-nil the return value is non-zero.
 //
-// Deprecated: use uintptr(Value.UnsafePointer()) to get the equivalent result.
+// It's preferred to use uintptr(Value.UnsafePointer()) to get the equivalent result.
 func (v Value) Pointer() uintptr {
        k := v.kind()
        switch k {
@@ -2479,7 +2479,7 @@ func (v Value) Uint() uint64 {
 // It is for advanced clients that also import the "unsafe" package.
 // It panics if v is not addressable.
 //
-// Deprecated: use uintptr(Value.Addr().UnsafePointer()) to get the equivalent result.
+// It's preferred to use uintptr(Value.Addr().UnsafePointer()) to get the equivalent result.
 func (v Value) UnsafeAddr() uintptr {
        if v.typ == nil {
                panic(&ValueError{"reflect.Value.UnsafeAddr", Invalid})