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

Fix printing of types in reporter output #293

Merged
merged 1 commit into from Apr 25, 2022
Merged

Conversation

dsnet
Copy link
Collaborator

@dsnet dsnet commented Apr 23, 2022

When printing a pointer, only elide the type for unnamed pointers.
Otherwise, we can run into situations where named and unnamed pointers
format the same way in indistinguishable ways.

When printing an interface, never explicitly skip printing the type.
Whether we skip printing the type should be determined by the
parent container type, and not locally determined.
For example, interface values within a struct, slice, or map
will always be elided since they can be inferred.

Fixes #291

When printing a pointer, only elide the type for unnamed pointers.
Otherwise, we can run into situations where named and unnamed pointers
format the same way in indistinguishable ways.

When printing an interview, never skip the interface type.
Whether we skip printing the type should be determined by the
parent containers, and not locally determined.
For examples, interface values within a struct, slice, or map
will always be elided since they can be inferred.
@dsnet dsnet requested a review from neild April 23, 2022 19:30
neild
neild approved these changes Apr 25, 2022
@dsnet dsnet merged commit 4664e24 into master Apr 25, 2022
33 checks passed
@dsnet dsnet deleted the dsnet/reporter-bug branch April 25, 2022 16:26
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.

Poor reporter output for concrete type versus interface type difference
2 participants