shithub: hugo

Download patch

ref: e88d7989907108b656eccd92bccc076be72a5c03
parent: c0eef3b401615e85bb74baee6a515abcf531fc2c
author: Christian Muehlhaeuser <muesli@gmail.com>
date: Fri Aug 2 11:20:36 EDT 2019

Fixed tautological error conditions

Drop error & nil checks where the value can not have changed.

--- a/common/herrors/error_locator.go
+++ b/common/herrors/error_locator.go
@@ -206,7 +206,7 @@
 
 	lines := strings.Split(string(b), "\n")
 
-	if le != nil && lepos.ColumnNumber >= 0 {
+	if lepos.ColumnNumber >= 0 {
 		pos.ColumnNumber = lepos.ColumnNumber
 	}
 
--- a/deploy/deploy.go
+++ b/deploy/deploy.go
@@ -143,9 +143,6 @@
 
 	// 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 {
--- a/resources/smartcrop.go
+++ b/resources/smartcrop.go
@@ -70,10 +70,7 @@
 
 	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