浏览代码

Better error message when no config files found

Nate Brown 5 年之前
父节点
当前提交
f65702a3b8
共有 1 个文件被更改,包括 4 次插入0 次删除
  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()