mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 20:42:26 +00:00
Remove unnecessary int type conversion
This commit is contained in:
parent
99ad88a261
commit
3b7c14e8cf
@ -136,7 +136,6 @@ func calcRestartCountByLogDir(path string) (int, error) {
|
||||
if _, err := os.Stat(path); err != nil {
|
||||
return 0, nil
|
||||
}
|
||||
restartCount := 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() {
|
||||
|
Loading…
Reference in New Issue
Block a user