mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 09:04:52 +01:00
fs: fix infinite recursive call in pacer ModifyCalculator (fixes issue reported by the staticcheck linter)
This commit is contained in:
parent
9172c9b3dd
commit
c502e00c87
@ -37,14 +37,6 @@ issues:
|
||||
- staticcheck
|
||||
text: 'SA1019: "golang.org/x/oauth2/jws" is deprecated'
|
||||
|
||||
# TODO: Investigate if this is a real issue. If not, i.e. it is a false
|
||||
# positive, consider instead excluding this check using a code comment!
|
||||
- path: ^fs[\\/]pacer\.go$
|
||||
linters:
|
||||
- staticcheck
|
||||
text: 'SA5007: infinite recursive call'
|
||||
|
||||
|
||||
run:
|
||||
# timeout for analysis, e.g. 30s, 5m, default is 1m
|
||||
timeout: 10m
|
||||
|
@ -73,7 +73,7 @@ func (p *Pacer) SetCalculator(c pacer.Calculator) {
|
||||
// ModifyCalculator calls the given function with the currently configured
|
||||
// Calculator and the Pacer lock held.
|
||||
func (p *Pacer) ModifyCalculator(f func(pacer.Calculator)) {
|
||||
p.ModifyCalculator(func(c pacer.Calculator) {
|
||||
p.Pacer.ModifyCalculator(func(c pacer.Calculator) {
|
||||
switch _c := c.(type) {
|
||||
case *logCalculator:
|
||||
f(_c.Calculator)
|
||||
|
Loading…
Reference in New Issue
Block a user