mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
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
This commit is contained in:
parent
647540d0ef
commit
e81c06c3f0
2 changed files with 3 additions and 3 deletions
|
@ -470,7 +470,7 @@ func FindCWD() (string, error) {
|
|||
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 @@ func SymbolicWalk(fs afero.Fs, root string, walker filepath.WalkFunc) error {
|
|||
|
||||
// Sanity check
|
||||
if len(root) < 4 {
|
||||
return WalkRootTooShortError
|
||||
return ErrWalkRootTooShort
|
||||
}
|
||||
|
||||
// Handle the root first
|
||||
|
|
|
@ -105,7 +105,7 @@ func (f *Filesystem) captureFiles() {
|
|||
|
||||
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.")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue