mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-01 22:42:45 +02:00
all: Fix some govet complaints
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
560ed6e686
commit
48120ccfd2
@@ -452,6 +452,7 @@ func (t *GoHTMLTemplate) loadTemplates(absPath string, prefix string) {
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
t.Log.DEBUG.Println("Template path", path)
|
||||
if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
|
||||
link, err := filepath.EvalSymlinks(absPath)
|
||||
@@ -459,11 +460,13 @@ func (t *GoHTMLTemplate) loadTemplates(absPath string, prefix string) {
|
||||
t.Log.ERROR.Printf("Cannot read symbolic link '%s', error was: %s", absPath, err)
|
||||
return nil
|
||||
}
|
||||
|
||||
linkfi, err := t.Fs.Source.Stat(link)
|
||||
if err != nil {
|
||||
t.Log.ERROR.Printf("Cannot stat '%s', error was: %s", link, err)
|
||||
return nil
|
||||
}
|
||||
|
||||
if !linkfi.Mode().IsRegular() {
|
||||
t.Log.ERROR.Printf("Symbolic links for directories not supported, skipping '%s'", absPath)
|
||||
}
|
||||
|
Reference in New Issue
Block a user