Skip to content

Commit

Permalink
Fix max length calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
koplas committed Feb 19, 2025
1 parent 0321f2e commit 6dedebb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/fakedoc/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,9 @@ func (gen *Generator) loremIpsum(minlength, maxlength int, unit LoremUnit, limit
minlength = 0
}
if maxlength < 0 {
maxLimit := limits.GetLimit()
maxlength = limits.GetLimit()
if !gen.ForceMaxSize {
maxLimit = int(float64(maxLimit) * gen.SizeFactor)
maxlength = int(float64(maxlength) * gen.SizeFactor)
}
}

Expand All @@ -602,9 +602,9 @@ func (gen *Generator) book(minlength, maxlength int, path string, limits *LimitN
minlength = 0
}
if maxlength < 0 {
maxLimit := limits.GetLimit()
maxlength = limits.GetLimit()
if !gen.ForceMaxSize {
maxLimit = int(float64(maxLimit) * gen.SizeFactor)
maxlength = int(float64(maxlength) * gen.SizeFactor)
}
}

Expand Down

0 comments on commit 6dedebb

Please sign in to comment.