From e07dd0d9911beb46fd0f429bceb07e127a3df5d2 Mon Sep 17 00:00:00 2001 From: Romain de Laage Date: Mon, 22 Aug 2022 17:28:38 +0200 Subject: [PATCH] Don't check if path is a directory (#220) 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) - } } } }