Skip to content

Commit

Permalink
Remove loop-related gocritic nolint entries
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrandon1 committed Nov 15, 2024
1 parent 52e5d79 commit 561a0c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions cmd/certsuite/claim/compare/testcases/testcases.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ type DiffReport struct {
func getTestCasesResultsMap(testSuiteResults claim.TestSuiteResults) map[string]string {
testCaseResults := map[string]string{}

//nolint:gocritic
for _, testCase := range testSuiteResults {
testCaseResults[testCase.TestID.ID] = testCase.State
for testCase := range testSuiteResults {
testCaseResults[testSuiteResults[testCase].TestID.ID] = testSuiteResults[testCase].State
}

return testCaseResults
Expand Down
10 changes: 4 additions & 6 deletions pkg/checksdb/checksdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,13 @@ func recordCheckResult(check *Check) {
// certsuite-claim's Go Client, results are generalized to map[string]interface{}.
func GetReconciledResults() map[string]claim.Result {
resultMap := make(map[string]claim.Result)
//nolint:gocritic
for key, val := range resultsDB {
for key := range resultsDB {
// initializes the result map, if necessary
if _, ok := resultMap[key]; !ok {
resultMap[key] = claim.Result{}
}

resultMap[key] = val
resultMap[key] = resultsDB[key]
}
return resultMap
}
Expand Down Expand Up @@ -223,9 +222,8 @@ func GetTotalTests() int {

func GetTestsCountByState(state string) int {
count := 0
//nolint:gocritic
for _, results := range resultsDB {
if results.State == state {
for r := range resultsDB {
if resultsDB[r].State == state {
count++
}
}
Expand Down

0 comments on commit 561a0c6

Please sign in to comment.