0
0
Fork 0
mirror of https://github.com/crazy-max/diun.git synced 2025-04-28 20:52:25 +00:00
crazy-max_diun/vendor/github.com/alecthomas/kong/defaults.go
dependabot[bot] 1e6b5759bd
chore(deps): bump github.com/alecthomas/kong from 1.6.0 to 1.6.1
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>
2025-01-07 07:26:07 +00:00

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()
}