Merge pull request #116902 from sourcelliu/cast

Remove unnecessary int type conversion
This commit is contained in:
Kubernetes Prow Robot 2023-04-20 19:15:10 -07:00 committed by GitHub
commit 7fe63a9b1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,7 +136,6 @@ func calcRestartCountByLogDir(path string) (int, error) {
if _, err := os.Stat(path); err != nil {
return 0, nil
}
restartCount := int(0)
files, err := os.ReadDir(path)
if err != nil {
return 0, err
@ -144,6 +143,7 @@ func calcRestartCountByLogDir(path string) (int, error) {
if len(files) == 0 {
return 0, nil
}
restartCount := 0
restartCountLogFileRegex := regexp.MustCompile(`^(\d+)\.log(\..*)?`)
for _, file := range files {
if file.IsDir() {