Skip to content

Commit e6a848a

Browse files
authored
[chore] Replace calls to deprecated method: reflect.PtrTo (#418)
This replaces all calls to the deprecated method reflect.PtrTo with the superceding method: reflect.PointerTo. See https://pkg.go.dev/reflect#PtrTo.
1 parent ed2ba32 commit e6a848a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

error.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ var _ digError = errMissingTypes(nil)
406406
func newErrMissingTypes(c containerStore, k key) errMissingTypes {
407407
// Possible types we will look for in the container. We will always look
408408
// for pointers to the requested type and some extras on a per-Kind basis.
409-
suggestions := []reflect.Type{reflect.PtrTo(k.t)}
409+
suggestions := []reflect.Type{reflect.PointerTo(k.t)}
410410

411411
if k.t.Kind() == reflect.Ptr {
412412
// The user requested a pointer but maybe we have a value.
@@ -415,7 +415,7 @@ func newErrMissingTypes(c containerStore, k key) errMissingTypes {
415415

416416
if k.t.Kind() == reflect.Slice {
417417
// Maybe the user meant a slice of pointers while we have the slice of elements
418-
suggestions = append(suggestions, reflect.SliceOf(reflect.PtrTo(k.t.Elem())))
418+
suggestions = append(suggestions, reflect.SliceOf(reflect.PointerTo(k.t.Elem())))
419419

420420
// Maybe the user meant a slice of elements while we have the slice of pointers
421421
sliceElement := k.t.Elem()
@@ -426,7 +426,7 @@ func newErrMissingTypes(c containerStore, k key) errMissingTypes {
426426

427427
if k.t.Kind() == reflect.Array {
428428
// Maybe the user meant an array of pointers while we have the array of elements
429-
suggestions = append(suggestions, reflect.ArrayOf(k.t.Len(), reflect.PtrTo(k.t.Elem())))
429+
suggestions = append(suggestions, reflect.ArrayOf(k.t.Len(), reflect.PointerTo(k.t.Elem())))
430430

431431
// Maybe the user meant an array of elements while we have the array of pointers
432432
arrayElement := k.t.Elem()

0 commit comments

Comments
 (0)