Bläddra i källkod

Better error message when no config files found

Nate Brown 5 år sedan
förälder
incheckning
f65702a3b8
1 ändrade filer med 4 tillägg och 0 borttagningar
  1. 4 0
      config.go

+ 4 - 0
config.go

@@ -40,6 +40,10 @@ func (c *Config) Load(path string) error {
 		return err
 	}
 
+	if len(c.files) == 0 {
+		return fmt.Errorf("no config files found at %s", path)
+	}
+
 	sort.Strings(c.files)
 
 	err = c.parse()