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

[miniredis] Add maxCullLen to minirdis.Dump() #268

Merged
merged 1 commit into from May 21, 2022

Conversation

afjoseph
Copy link
Contributor

Hey. Thanks for the fantastic project!

Currently, miniredis.Dump() limits the string length to 80. During unit tests sessions, it's really useful to know the contents of the entire DB while inside a debugger (i.e., delve).

The change I made doesn't break the API; it just makes maxLen modifiable.

Thanks again!

miniredis.go Outdated
@@ -340,25 +340,36 @@ func (m *Miniredis) Server() *server.Server {
return m.srv
}

type DumpOptions struct {
maxCullLen int
Copy link
Owner

Choose a reason for hiding this comment

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

That will have to be exported: MaxCullLen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer relevant: using a global var

@alicebob
Copy link
Owner

Thanks for the PR! Did you consider making it a global var? var miniredis.DumpMaxLineLength = 60 or something (ideally a bit shorter name).

@afjoseph
Copy link
Contributor Author

@alicebob Hey. Thanks for the quick reply!

I agree that a global var is easier and cleaner to work with. Done and done. Lemme know how this looks now

@alicebob alicebob merged commit c6a13ad into alicebob:master May 21, 2022
@alicebob
Copy link
Owner

Thanks for the PR! It's merged, will make it a proper release in a few days.

@afjoseph afjoseph deleted the addMaxLen branch May 21, 2022 15:36
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.

None yet

2 participants