rework map and slice support

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2022-03-23 00:57:59 +03:00
parent 0611fd60d2
commit 7a2461f7ce
3 changed files with 227 additions and 120 deletions

10
flag.go
View File

@@ -53,7 +53,15 @@ func (c *flagConfig) Init(opts ...config.Option) error {
rcheck := true
switch sf.Value.Interface().(type) {
if !sf.Value.IsValid() {
continue
}
vi := sf.Value.Interface()
if vi == nil {
continue
}
switch vi.(type) {
case time.Duration:
err = c.flagDuration(sf.Value, fn, fv, fd)
rcheck = false