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] Fix go vet error in error.go #419

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
2 changes: 1 addition & 1 deletion 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)
fmt.Fprint(w, e.Message)
}

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)}

Check failure on line 409 in error.go

View workflow job for this annotation

GitHub Actions / Lint

SA1019: reflect.PtrTo has been deprecated since Go 1.22 and an alternative has been available since Go 1.18: Superseded by [PointerTo]. (staticcheck)

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())))

Check failure on line 418 in error.go

View workflow job for this annotation

GitHub Actions / Lint

SA1019: reflect.PtrTo has been deprecated since Go 1.22 and an alternative has been available since Go 1.18: Superseded by [PointerTo]. (staticcheck)

// 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())))

Check failure on line 429 in error.go

View workflow job for this annotation

GitHub Actions / Lint

SA1019: reflect.PtrTo has been deprecated since Go 1.22 and an alternative has been available since Go 1.18: Superseded by [PointerTo]. (staticcheck)

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