Replace time.After with a timer created only once for a function call.#1966
Replace time.After with a timer created only once for a function call.#1966alexeykiselev wants to merge 12 commits intomasterfrom
Conversation
Linter exclusion comments updated.
| // The peer was not found in the larges group, time to change the peer. | ||
| // Select the random peer from the group and return it along with a new score value. | ||
| i := rand.IntN(len(g.peers)) // #nosec: it's ok to use math/rand/v2 here | ||
| i := rand.IntN(len(g.peers)) //nolint: gosec // it's ok to use math/rand/v2 here. |
Check failure
Code scanning / gosec
Use of weak random number generator (math/rand or math/rand/v2 instead of crypto/rand) Error
| return PeerInfo{}, err | ||
| } | ||
| n := rand.IntN(len(ips)) // #nosec: it's ok to use math/rand/v2 here | ||
| n := rand.IntN(len(ips)) //nolint: gosec // it's ok to use math/rand/v2 here. |
Check failure
Code scanning / gosec
Use of weak random number generator (math/rand or math/rand/v2 instead of crypto/rand) Error
Moved TODOs from error handling blocks whether possible without loosing context. Added suppression comments for test data that looks like telegram bot API keys or AWS access tokens or generic API keys. Call to time.After replaced with single Timer in session's keepAliveLoop function.
Added more suppression comments for API keys lookalike data.
| itests/config/template.conf | ||
|
|
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: generic.ci.audit.changed-semgrepignore.changed-semgrepignore Warning
| **/*.pb.go | ||
| **/*.gen.go |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: generic.ci.audit.changed-semgrepignore.changed-semgrepignore Warning
|
|
||
| # Ignore generated protobuf files | ||
| **/*.pb.go | ||
| **/*.gen.go |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: generic.ci.audit.changed-semgrepignore.changed-semgrepignore Warning
Fixed error handling in the package.
No description provided.