Skip to content

Commit

Permalink
follow-up merge conflict fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrks committed Jul 8, 2024
1 parent b0b5680 commit 0f24f7f
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions rest/config_flags.go
Original file line number Diff line number Diff line change
@@ -184,32 +184,45 @@ func fillConfigWithFlags(fs *flag.FlagSet, flags map[string]configFlag) error {
}

switch rval.Interface().(type) {
case *bool:
case *string:
if pointer {
rval.Set(reflect.ValueOf(val.flagValue))
} else {
*val.config.(*bool) = *val.flagValue.(*bool)
*val.config.(*string) = *val.flagValue.(*string)
}
case *[]string:
list := strings.Split(*val.flagValue.(*string), ",")
*val.config.(*[]string) = list
case *uint:
if pointer {
rval.Set(reflect.ValueOf(val.flagValue))
} else {
*val.config.(*uint) = *val.flagValue.(*uint)
}
case *uint64:
if pointer {
rval.Set(reflect.ValueOf(val.flagValue))
} else {
*val.config.(*uint64) = *val.flagValue.(*uint64)
}
case *int:
if pointer {
rval.Set(reflect.ValueOf(val.flagValue))
} else {
*val.config.(*int) = *val.flagValue.(*int)
}
case *int64:
case *bool:
if pointer {
rval.Set(reflect.ValueOf(val.flagValue))
} else {
*val.config.(*int64) = *val.flagValue.(*int64)
*val.config.(*bool) = *val.flagValue.(*bool)
}
case *uint:
case *int64:
if pointer {
rval.Set(reflect.ValueOf(val.flagValue))
} else {
*val.config.(*uint) = *val.flagValue.(*uint)
*val.config.(*int64) = *val.flagValue.(*int64)
}
case *uint64:
*val.config.(*uint64) = *val.flagValue.(*uint64)
case *base.ConfigDuration:
duration, err := time.ParseDuration(*val.flagValue.(*string))
if err != nil {

0 comments on commit 0f24f7f

Please sign in to comment.