mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Fixed tautological error conditions
Drop error & nil checks where the value can not have changed.
This commit is contained in:
parent
c0eef3b401
commit
e88d798990
3 changed files with 2 additions and 8 deletions
|
@ -206,7 +206,7 @@ func locateError(r io.Reader, le FileError, matches LineMatcherFn) ErrorContext
|
|||
|
||||
lines := strings.Split(string(b), "\n")
|
||||
|
||||
if le != nil && lepos.ColumnNumber >= 0 {
|
||||
if lepos.ColumnNumber >= 0 {
|
||||
pos.ColumnNumber = lepos.ColumnNumber
|
||||
}
|
||||
|
||||
|
|
|
@ -143,9 +143,6 @@ func (d *Deployer) Deploy(ctx context.Context) error {
|
|||
|
||||
// Diff local vs remote to see what changes need to be applied.
|
||||
uploads, deletes := findDiffs(local, remote, d.force)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
d.summary.NumUploads = len(uploads)
|
||||
d.summary.NumDeletes = len(deletes)
|
||||
if len(uploads)+len(deletes) == 0 {
|
||||
|
|
|
@ -70,10 +70,7 @@ func smartCrop(img image.Image, width, height int, anchor imaging.Anchor, filter
|
|||
|
||||
b := img.Bounds().Intersect(rect)
|
||||
|
||||
cropped, err := imaging.Crop(img, b), nil
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cropped := imaging.Crop(img, b)
|
||||
|
||||
return imaging.Resize(cropped, width, height, filter), nil
|
||||
|
||||
|
|
Loading…
Reference in a new issue