Replace reflect.PtrTo with reflect.PointerTo.
Fixes #59599
Change-Id: I49407193e2050543ef983cd637703acc682d9f51
Change-Id: I49407193e2050543ef983cd637703acc682d9f51
GitHub-Last-Rev:
7bc9ccf1dcb4b444406430b451ad4c47c6ec1be2
GitHub-Pull-Request: golang/go#61440
Reviewed-on: https://go-review.googlesource.com/c/go/+/511035
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
--- /dev/null
+pkg reflect, func PtrTo //deprecated #59599
keep := base.Ctxt.Flag_dynlink
if !keep && t.Sym() == nil {
// For an unnamed type, we only need the link if the type can
- // be created at run time by reflect.PtrTo and similar
+ // be created at run time by reflect.PointerTo and similar
// functions. If the type exists in the program, those
// functions must return the existing type structure rather
// than creating a new one.
errorf("%s slice too big: %d elements of %d bytes", typ.Elem(), u, size)
}
if value.Cap() < n {
- safe := saferio.SliceCap(reflect.Zero(reflect.PtrTo(typ.Elem())).Interface(), uint64(n))
+ safe := saferio.SliceCap(reflect.Zero(reflect.PointerTo(typ.Elem())).Interface(), uint64(n))
if safe < 0 {
errorf("%s slice too big: %d elements of %d bytes", typ.Elem(), u, size)
}
//
// PtrTo is the old spelling of PointerTo.
// The two functions behave identically.
+//
+// Deprecated: Superseded by [PointerTo].
func PtrTo(t Type) Type { return PointerTo(t) }
// PointerTo returns the pointer type with element t.