go-defaults icon indicating copy to clipboard operation
go-defaults copied to clipboard

Feature: Add support for an interface for complicated defaults

Open Eyal-Shalev opened this issue 3 years ago • 0 comments

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

Eyal-Shalev avatar May 06 '21 08:05 Eyal-Shalev