Skip to content

Commit

Permalink
chore: use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...))
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored and sjqzhang committed Jan 8, 2024
1 parent 8c79a1e commit 6900e3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/fileserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion server/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6900e3d

Please sign in to comment.