Read and merge all files in the specified directory matching the supplied suffix
(fsys fs.FS, logPrefix string, dirName string, fileName string, simpleMerge bool)
| 634 | |
| 635 | // Read and merge all files in the specified directory matching the supplied suffix |
| 636 | func readConfigFilesForDir(fsys fs.FS, logPrefix string, dirName string, fileName string, simpleMerge bool) (waveobj.MetaMapType, []ConfigError) { |
| 637 | dirEnts, _ := fs.ReadDir(fsys, dirName) |
| 638 | suffixEnts := selectDirEntsBySuffix(dirEnts, fileName+".json") |
| 639 | SortFileNameDescend(suffixEnts) |
| 640 | var rtn waveobj.MetaMapType |
| 641 | var errs []ConfigError |
| 642 | for _, ent := range suffixEnts { |
| 643 | fileVal, cerrs := readConfigFileFS(fsys, logPrefix, filepath.Join(dirName, ent.Name())) |
| 644 | rtn = mergeMetaMap(rtn, fileVal, simpleMerge) |
| 645 | errs = append(errs, cerrs...) |
| 646 | } |
| 647 | return rtn, errs |
| 648 | } |
| 649 | |
| 650 | // Read and merge all files in the specified config filesystem matching the patterns `<partName>.json` and `<partName>/*.json` |
| 651 | func readConfigPartForFS(fsys fs.FS, logPrefix string, partName string, simpleMerge bool) (waveobj.MetaMapType, []ConfigError) { |
no test coverage detected