Skip to content

Commit

Permalink
fs: fix infinite recursive call in pacer ModifyCalculator (fixes issu…
Browse files Browse the repository at this point in the history
…e reported by the staticcheck linter)
  • Loading branch information
albertony committed Mar 26, 2023
1 parent 9172c9b commit c502e00
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fs/pacer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c502e00

Please sign in to comment.