Explorar el Código

Better error message when no config files found

Nate Brown hace 5 años
padre
commit
f65702a3b8
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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()