Bump github.com/gookit/config/v2 from 2.2.2 to 2.2.3

Bumps [github.com/gookit/config/v2](https://github.com/gookit/config) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/gookit/config/releases)
- [Commits](https://github.com/gookit/config/compare/v2.2.2...v2.2.3)

---
updated-dependencies:
- dependency-name: github.com/gookit/config/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2023-08-30 13:10:31 +02:00
committed by Ralf Haferkamp
parent 69bd2c24a7
commit 0aafeccb93
20 changed files with 335 additions and 182 deletions
+10 -12
View File
@@ -90,23 +90,21 @@ func (c *Config) Structure(key string, dst any) error {
}
}
// init default value by tag: default
if c.opts.ParseDefault {
err := structs.InitDefaults(dst, func(opt *structs.InitOptions) {
opt.ParseEnv = c.opts.ParseEnv
})
if err != nil {
return err
}
}
bindConf := c.opts.makeDecoderConfig()
// set result struct ptr
bindConf.Result = dst
decoder, err := mapstructure.NewDecoder(bindConf)
if err == nil {
err = decoder.Decode(data)
if err = decoder.Decode(data); err != nil {
return err
}
}
// init default value by tag: default
if c.opts.ParseDefault {
err = structs.InitDefaults(dst, func(opt *structs.InitOptions) {
opt.ParseEnv = c.opts.ParseEnv
})
}
return err
}