Skip to content

Commit

Permalink
app: fix for loop linting (#3194)
Browse files Browse the repository at this point in the history
Fix linter from stacksnipe PR...

category: misc
ticket: none
  • Loading branch information
KaloyanTanev authored Jul 25, 2024
1 parent 34f7d83 commit 1faa1e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/monitoringapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func quorumPeersConnected(peerIDs []peer.ID, tcpNode host.Host) bool {
func stackComponents(names []string, cliParams []string) {
validatorStackParamsGauge.Reset()

for i := 0; i < len(names); i++ {
for i := range len(names) {
validatorStackParamsGauge.WithLabelValues(names[i], cliParams[i]).Set(1)
}
}
Expand Down
6 changes: 3 additions & 3 deletions app/stacksnipe/stacksnipe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ func Test_StackSnipe(t *testing.T) {
"run_1",
}

for idx := 0; idx < len(names); idx++ {
for idx := range len(names) {
populateProc(t, baseDir, procEntry{
pid: uint64(42 + idx),
procName: names[idx],
cmdline: cmdlines[idx],
})
}

for idx := 0; idx < len(extraNames); idx++ {
for idx := range len(extraNames) {
populateProc(t, baseDir, procEntry{
pid: uint64(52 + idx),
procName: extraNames[idx],
Expand Down Expand Up @@ -98,7 +98,7 @@ func Test_StackSnipe(t *testing.T) {
require.ElementsMatch(t, result.names, namesExpected)
require.ElementsMatch(t, result.cmdlines, cmdlines)

for idx := 0; idx < len(extraNames); idx++ {
for idx := range len(extraNames) {
require.NotContains(t, result.names, extraNames[idx])
require.NotContains(t, result.cmdlines, extraCmdlines[idx])
}
Expand Down

0 comments on commit 1faa1e5

Please sign in to comment.