Give maxLen its own literal and repeats MaxRepeat; arg errors name the spelling and the range; write's comment says what Flush reports; assert 64-bit at compile time
This commit was merged in pull request #3.
This commit is contained in:
@@ -181,8 +181,8 @@ func checkRepeatReach(root map[string]node) error {
|
||||
return r
|
||||
}
|
||||
return walkNodes(root, func(path string, n node) error {
|
||||
if t, ok := n.(*template); ok && t.repeat > 1 && of(n) > maxLen {
|
||||
return fmt.Errorf("%s: repeat %d multiplies to %d renders along one path, above the maximum %d", path, t.repeat, of(n), maxLen)
|
||||
if t, ok := n.(*template); ok && t.repeat > 1 && of(n) > MaxRepeat {
|
||||
return fmt.Errorf("%s: repeat %d multiplies to %d renders along one path, above the maximum %d", path, t.repeat, of(n), MaxRepeat)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user