all: Fix some govet complaints

This commit is contained in:
Albert Nigmatzianov
2017-03-09 18:18:12 +05:00
committed by Bjørn Erik Pedersen
parent 560ed6e686
commit 48120ccfd2
9 changed files with 12 additions and 15 deletions

View File

@@ -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)
}