Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Replace calls to deprecated method: reflect.PtrTo #418

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
func (e errInvalidInput) Unwrap() error { return e.Cause }

func (e errInvalidInput) writeMessage(w io.Writer, _ string) {
fmt.Fprintf(w, e.Message)

Check failure on line 189 in error.go

View workflow job for this annotation

GitHub Actions / Lint

printf: non-constant format string in call to fmt.Fprintf (govet)
}

func (e errInvalidInput) Format(w fmt.State, c rune) {
Expand Down Expand Up @@ -406,7 +406,7 @@
func newErrMissingTypes(c containerStore, k key) errMissingTypes {
// Possible types we will look for in the container. We will always look
// for pointers to the requested type and some extras on a per-Kind basis.
suggestions := []reflect.Type{reflect.PtrTo(k.t)}
suggestions := []reflect.Type{reflect.PointerTo(k.t)}

if k.t.Kind() == reflect.Ptr {
// The user requested a pointer but maybe we have a value.
Expand All @@ -415,7 +415,7 @@

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

// Maybe the user meant a slice of elements while we have the slice of pointers
sliceElement := k.t.Elem()
Expand All @@ -426,7 +426,7 @@

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

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