chore: use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...))

This commit is contained in:
guoguangwu 2023-07-11 17:02:40 +08:00 committed by 小张
parent 8c79a1e3d1
commit 6900e3d416
2 changed files with 2 additions and 2 deletions

View File

@ -723,7 +723,7 @@ func (c *Server) GetMd5sMapByDate(date string, filename string) (*goutil.CommonM
fpath = DATA_DIR + "/" + date + "/" + filename
}
if !c.util.FileExists(fpath) {
return result, errors.New(fmt.Sprintf("fpath %s not found", fpath))
return result, fmt.Errorf("fpath %s not found", fpath)
}
if data, err = ioutil.ReadFile(fpath); err != nil {
return result, err

View File

@ -108,7 +108,7 @@ func (c *Server) initTus() {
return nil, errors.New(msg)
}
}
return nil, errors.New(fmt.Sprintf("%s not found", fp))
return nil, fmt.Errorf("%s not found", fp)
}
}
store.UseIn(composer)