mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 04:52:08 +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 {
|
if _, err := os.Stat(path); err != nil {
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
restartCount := 0
|
|
||||||
files, err := os.ReadDir(path)
|
files, err := os.ReadDir(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
@ -144,6 +143,7 @@ func calcRestartCountByLogDir(path string) (int, error) {
|
|||||||
if len(files) == 0 {
|
if len(files) == 0 {
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
restartCount := 0
|
||||||
restartCountLogFileRegex := regexp.MustCompile(`^(\d+)\.log(\..*)?`)
|
restartCountLogFileRegex := regexp.MustCompile(`^(\d+)\.log(\..*)?`)
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
if file.IsDir() {
|
if file.IsDir() {
|
||||||
|
Loading…
Reference in New Issue
Block a user