mirror of
https://github.com/crazy-max/diun.git
synced 2025-04-28 20:52:25 +00:00
![dependabot[bot]](/assets/img/avatar_default.png)
Bumps [github.com/alecthomas/kong](https://github.com/alecthomas/kong) from 1.6.0 to 1.6.1. - [Release notes](https://github.com/alecthomas/kong/releases) - [Commits](https://github.com/alecthomas/kong/compare/v1.6.0...v1.6.1) --- updated-dependencies: - dependency-name: github.com/alecthomas/kong dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
21 lines
389 B
Go
21 lines
389 B
Go
package kong
|
|
|
|
// ApplyDefaults if they are not already set.
|
|
func ApplyDefaults(target any, options ...Option) error {
|
|
app, err := New(target, options...)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
ctx, err := Trace(app, nil)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
err = ctx.Resolve()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if err = ctx.ApplyDefaults(); err != nil {
|
|
return err
|
|
}
|
|
return ctx.Validate()
|
|
}
|