diff --git a/configstruct.go b/configstruct.go index 3509d36..043c4c0 100644 --- a/configstruct.go +++ b/configstruct.go @@ -55,7 +55,7 @@ func ParseWithFlagSet(flagSet *flag.FlagSet, cliArgs []string, c interface{}, op return fmt.Errorf("argument %s is required", name) } - if required { + if argVal != "" { value.Set(reflect.ValueOf(argVal)) } }