Skip to content

Commit

Permalink
Fix suggestion commit and indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fsologureng committed Jan 16, 2023
1 parent 31ddda6 commit d1d2020
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions modules/log/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,21 +232,20 @@ func (log *FileLogger) deleteOldLog() {
}
}()

if err != nil {
return err
}
if returnErr != nil {
return returnErr
}
if d.IsDir() {
return nil
}
info, err := d.Info()
if err != nil {
return err
}
if info.ModTime().Unix() < (time.Now().Unix() - 60*60*24*log.Maxdays) {
if strings.HasPrefix(filepath.Base(path), filepath.Base(log.Filename)) {
if err := util.Remove(path); err != nil {
returnErr = fmt.Errorf("Failed to remove %s: %w", path, err)
}
info, err := d.Info()
if err != nil {
return err
}
if info.ModTime().Unix() < (time.Now().Unix() - 60*60*24*log.Maxdays) {
if strings.HasPrefix(filepath.Base(path), filepath.Base(log.Filename)) {
if err := util.Remove(path); err != nil {
returnErr = fmt.Errorf("Failed to remove %s: %w", path, err)
}
}
}
Expand Down

0 comments on commit d1d2020

Please sign in to comment.