Skip to content

Commit

Permalink
fixup! [miniredis] Add maxCullLen to minirdis.Dump()
Browse files Browse the repository at this point in the history
  • Loading branch information
afjoseph committed May 20, 2022
1 parent e3115d6 commit 6989f93
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions miniredis.go
Expand Up @@ -341,10 +341,15 @@ func (m *Miniredis) Server() *server.Server {
}

type DumpOptions struct {
maxCullLen int
MaxCullLen int
}

// Dump returns a text version of the selected DB, usable for debugging.
//
// Dump limits the maximum length of each key:value to 60 characters.
// To increase that, call something like:
//
// mr.Dump(miniredis.DumpOptions{MaxCullLen: 1000}))
func (m *Miniredis) Dump(opts ...DumpOptions) string {
m.Lock()
defer m.Unlock()
Expand All @@ -364,8 +369,8 @@ func (m *Miniredis) Dump(opts ...DumpOptions) string {
}
)
for _, opt := range opts {
if opt.maxCullLen > 0 {
maxCullLen = opt.maxCullLen
if opt.MaxCullLen > 0 {
maxCullLen = opt.MaxCullLen
}
break // Break after the first one
}
Expand Down

0 comments on commit 6989f93

Please sign in to comment.