declare new errs inline if

This commit is contained in:
sentriz
2024-02-20 13:14:13 +00:00
parent 70ff70cdfa
commit c6cec8307a
3 changed files with 3 additions and 3 deletions

View File

@@ -160,7 +160,7 @@ func coverScaleAndSave(reader io.Reader, cachePath string, size int) error {
// don't upscale images
width = src.Bounds().Dx()
}
if err = imaging.Save(imaging.Resize(src, width, 0, imaging.Lanczos), cachePath); err != nil {
if err := imaging.Save(imaging.Resize(src, width, 0, imaging.Lanczos), cachePath); err != nil {
return fmt.Errorf("caching %q: %w", cachePath, err)
}
return nil