Cleanup: enable lint of revive(superfluous-else)

Signed-off-by: Lan Liang <gcslyp@gmail.com>
This commit is contained in:
Lan Liang 2024-01-02 08:35:42 +00:00
parent c218f93ce3
commit 59cd00d942
3 changed files with 6 additions and 5 deletions

View File

@ -66,6 +66,9 @@ linters-settings:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#if-return
- name: if-return
disabled: true
- name: superfluous-else
arguments:
- preserveScope
staticcheck:
checks:
- all

View File

@ -285,10 +285,9 @@ func readHTTPWithRetries(get httpget, duration time.Duration, u string, attempts
if statusCode >= 500 && statusCode < 600 {
// Retry 500's
continue
} else {
// Don't retry other StatusCodes
break
}
// Don't retry other StatusCodes
break
}
return nil, err
}

View File

@ -77,9 +77,8 @@ func WaitFederatedResourceQuotaCollectStatus(client karmada.Interface, namespace
matched = true
if reflect.DeepEqual(assign.Hard, aggregated.Hard) {
break
} else {
return false, nil
}
return false, nil
}
if !matched {
return false, nil