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

feat: add String() to rueidis.RedisResult for easy debugging #353

Merged
merged 5 commits into from
Aug 31, 2023

Conversation

Exca-DK
Copy link
Contributor

@Exca-DK Exca-DK commented Aug 28, 2023

closes #292

@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2023

Codecov Report

Patch coverage: 75.43% and project coverage change: -0.05% ⚠️

Comparison is base (19e115b) 97.61% compared to head (706a520) 97.56%.
Report is 4 commits behind head on main.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #353      +/-   ##
==========================================
- Coverage   97.61%   97.56%   -0.05%     
==========================================
  Files          76       76              
  Lines       30467    30524      +57     
==========================================
+ Hits        29739    29780      +41     
- Misses        613      623      +10     
- Partials      115      121       +6     
Files Changed Coverage Δ
message.go 98.42% <75.43%> (-1.58%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rueian
Copy link
Collaborator

rueian commented Aug 29, 2023

Hi @Exca-DK,

Thank you for implementing this. However, I am hesitant about adding the json.Marshaler interface.

People will most likely expect the json.Marshaler should be performant and its output can be restored back to the source struct by using json.Unmarshal.

I think we had better just keep the Stringer interface which is widely accepted as a debugging helper.

message.go Outdated Show resolved Hide resolved
@Exca-DK
Copy link
Contributor Author

Exca-DK commented Aug 29, 2023

You are right, I made it into an internal type, it shouldn't be known to people at all. What do you think?

@Exca-DK Exca-DK requested a review from rueian August 29, 2023 16:08
message.go Outdated Show resolved Hide resolved
message.go Outdated Show resolved Hide resolved
message.go Outdated Show resolved Hide resolved
@rueian
Copy link
Collaborator

rueian commented Aug 30, 2023

Hi @Exca-DK,

Could you also add tests for these uncovered lines?
image

@rueian rueian merged commit 3f0b61d into redis:main Aug 31, 2023
@rueian
Copy link
Collaborator

rueian commented Aug 31, 2023

Thanks @Exca-DK!

@rueian rueian changed the title Feat: Human readable results feat: add String() to RedisResult for easy debugging Sep 1, 2023
@rueian rueian changed the title feat: add String() to RedisResult for easy debugging feat: add String() to rueidis.RedisResult for easy debugging Sep 1, 2023
@rueian rueian added the feature label Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dump RedisResult response structures to console/log/JSON/etc.
3 participants