maxAttempts resolves MaxAttempts to an effective value: 0 → default 5, negative → unlimited (returned as -1), positive → as configured.
()
| 132 | // maxAttempts resolves MaxAttempts to an effective value: 0 → default 5, |
| 133 | // negative → unlimited (returned as -1), positive → as configured. |
| 134 | func (p Policy) maxAttempts() int { |
| 135 | if p.MaxAttempts == 0 { |
| 136 | return 5 |
| 137 | } |
| 138 | return p.MaxAttempts |
| 139 | } |
| 140 | |
| 141 | // logger returns p.Logger or slog.Default if nil. |
| 142 | func (p Policy) logger() *slog.Logger { |