Defaults fills a struct pointer with default values from the "default" tag. It only fills public fields. - Scalars can be provided directly - maps, structs, etc. can be provided in JSON format - time.Duration can be provided in text format (e.g. 60s)
(data interface{})
| 8 | // - maps, structs, etc. can be provided in JSON format |
| 9 | // - time.Duration can be provided in text format (e.g. 60s) |
| 10 | func Defaults(data interface{}) { |
| 11 | defaults.MustSet(data) |
| 12 | } |
| 13 | |
| 14 | // DefaultsProvider is a struct that has a custom default setter. |
| 15 | type DefaultsProvider interface { |
no outgoing calls