From 9a27d23c3873949417f1cdbacddc1193de7c3919 Mon Sep 17 00:00:00 2001 From: Romain de Laage Date: Thu, 18 Aug 2022 12:06:56 +0200 Subject: [PATCH] Don't check if path is a directory We only run a stat on the path to check there is no error --- internal/location.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/location.go b/internal/location.go index 0bfb853..fe047b7 100644 --- a/internal/location.go +++ b/internal/location.go @@ -74,12 +74,8 @@ func (l Location) validate() error { if from, err := GetPathRelativeToConfig(path); err != nil { return err } else { - if stat, err := os.Stat(from); err != nil { + if _, err := os.Stat(from); err != nil { return err - } else { - if !stat.IsDir() { - return fmt.Errorf("\"%s\" is not valid directory for location \"%s\"", from, l.name) - } } } }