Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove loop-related gocritic nolint entries #2571

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading