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

pkg/terminal: use reflect.Value.IsValid to check a zero Value #3450

Merged
merged 1 commit into from
Aug 1, 2023
Merged

pkg/terminal: use reflect.Value.IsValid to check a zero Value #3450

merged 1 commit into from
Aug 1, 2023

Conversation

callthingsoff
Copy link
Contributor

I searched the source code of Go, and found no usages of "== (reflect.Value{})" and "!= (reflect.Value{})". I think it's more idiomatic to use "IsValid" to check a zero Value.

Please take a look, thanks.

I searched the source code of Go, and found no usages of
"== (reflect.Value{})" and "!= (reflect.Value{})". I think
it's more idiomatic to use "IsValid" to check a zero Value.
@callthingsoff
Copy link
Contributor Author

callthingsoff commented Jul 30, 2023

Please see https://go-review.googlesource.com/c/go/+/308769

If my understanding is wrong, sorry, please abandon this PR.

Copy link
Member

@derekparker derekparker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@derekparker
Copy link
Member

Test failures are unrelated.

@derekparker derekparker merged commit b5c9edc into go-delve:master Aug 1, 2023
1 check failed
@callthingsoff callthingsoff deleted the reflect_value_is_valid branch August 1, 2023 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants