shithub: hugo

Download patch

ref: e81c06c3f0a6f9a960d91b31960e48a807112655
parent: 647540d0ef9819c35819715f1f35198f05e5409e
author: bogem <[email protected]>
date: Mon Nov 21 18:00:44 EST 2016

helpers: Rename WalkRootTooShortError to ErrWalkRootTooShort

Fix golint warning: helpers/path.go:473:5: error var
WalkRootTooShortError should have name of the form ErrFoo

See #2014

--- a/helpers/path.go
+++ b/helpers/path.go
@@ -470,7 +470,7 @@
 	return path, nil
 }
 
-var WalkRootTooShortError = errors.New("Path too short. Stop walking.")
+var ErrWalkRootTooShort = errors.New("Path too short. Stop walking.")
 
 // SymbolicWalk is like filepath.Walk, but it supports the root being a
 // symbolic link. It will still not follow symbolic links deeper down in
@@ -479,7 +479,7 @@
 
 	// Sanity check
 	if len(root) < 4 {
-		return WalkRootTooShortError
+		return ErrWalkRootTooShort
 	}
 
 	// Handle the root first
--- a/source/filesystem.go
+++ b/source/filesystem.go
@@ -105,7 +105,7 @@
 
 	if err != nil {
 		jww.ERROR.Println(err)
-		if err == helpers.WalkRootTooShortError {
+		if err == helpers.ErrWalkRootTooShort {
 			panic("The root path is too short. If this is a test, make sure to init the content paths.")
 		}
 	}