diff options
author | Christian Muehlhaeuser <[email protected]> | 2019-08-02 15:20:36 +0000 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-08-10 01:04:43 +0200 |
commit | e88d7989907108b656eccd92bccc076be72a5c03 (patch) | |
tree | 7a739f8d3debf252f1c804d08fe98965c95d0b5f | |
parent | c0eef3b401615e85bb74baee6a515abcf531fc2c (diff) | |
download | hugo-e88d7989907108b656eccd92bccc076be72a5c03.tar.gz hugo-e88d7989907108b656eccd92bccc076be72a5c03.zip |
Fixed tautological error conditions
Drop error & nil checks where the value can not have changed.
-rw-r--r-- | common/herrors/error_locator.go | 2 | ||||
-rw-r--r-- | deploy/deploy.go | 3 | ||||
-rw-r--r-- | resources/smartcrop.go | 5 |
3 files changed, 2 insertions, 8 deletions
diff --git a/common/herrors/error_locator.go b/common/herrors/error_locator.go index 15de6d318..3778a3729 100644 --- a/common/herrors/error_locator.go +++ b/common/herrors/error_locator.go @@ -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 } diff --git a/deploy/deploy.go b/deploy/deploy.go index 0512e352e..6abb9e24e 100644 --- a/deploy/deploy.go +++ b/deploy/deploy.go @@ -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 { diff --git a/resources/smartcrop.go b/resources/smartcrop.go index 05bc55cd7..d28a8dd03 100644 --- a/resources/smartcrop.go +++ b/resources/smartcrop.go @@ -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 |