#8 up parse yaml
This commit is contained in:
@@ -104,13 +104,18 @@ func main() {
|
||||
|
||||
for _, configDir := range configDirs {
|
||||
for _, configFile := range configFiles {
|
||||
path := filepath.Join(configDir, configFile)
|
||||
if _, err = os.Stat(path); os.IsNotExist(err) {
|
||||
continue
|
||||
}
|
||||
|
||||
c := fileconfig.NewConfig(
|
||||
config.AllowFail(false),
|
||||
config.Struct(cfg),
|
||||
options.Codec(yamlcodec.NewCodec()),
|
||||
fileconfig.Path(filepath.Join(configDir, configFile)),
|
||||
fileconfig.Path(path),
|
||||
)
|
||||
err = c.Init(options.Context(ctx))
|
||||
err = c.Init()
|
||||
if err != nil {
|
||||
logger.Error(ctx, fmt.Sprintf("failed to init config: %v", err))
|
||||
}
|
||||
|
Reference in New Issue
Block a user