apply go tools cleanup

This commit is contained in:
2022-06-21 21:32:16 -04:00
parent a61be99d03
commit f1accd3006
7 changed files with 69 additions and 37 deletions

View File

@ -41,7 +41,10 @@ func NewScheduler(filePath string) (Scheduler, error) {
if err != nil {
return nil, fmt.Errorf("path:%v does not exist and unable to create: err: %w", filePath, err)
}
f.Close()
err = f.Close()
if err != nil {
return nil, err
}
log.Info("scheduler file does not exist, will be created", "path", filePath)
} else {
err = yaml.Unmarshal(data, &s.lastSuccessTime)