libcni conf: support .json file extension

Content of the files are json, the configuration load should support .json
This commit is contained in:
Julien Balestra
2016-11-23 10:46:17 +01:00
parent de002ff25a
commit a85593ce0d
2 changed files with 18 additions and 1 deletions

View File

@ -55,7 +55,8 @@ func ConfFiles(dir string) ([]string, error) {
if f.IsDir() {
continue
}
if filepath.Ext(f.Name()) == ".conf" {
fileExt := filepath.Ext(f.Name())
if fileExt == ".conf" || fileExt == ".json" {
confFiles = append(confFiles, filepath.Join(dir, f.Name()))
}
}