go-defaults
go-defaults copied to clipboard
Feature: Add support for an interface for complicated defaults
type Defaults interface {
Defaults(raw string) (interface{}, error)
}
example
type Duration time.Duration
func (d *Duration) Defaults(raw string) (interface{}, error) {
return time.ParseDuration(raw)
}