fix gocyclo warnings (#278)

master
Kevin Wan 4 years ago committed by GitHub
parent c686c93fb5
commit c435811479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -153,9 +153,11 @@ func doParseKeyAndOptions(field reflect.StructField, value string) (string, *fie
key := strings.TrimSpace(segments[0]) key := strings.TrimSpace(segments[0])
options := segments[1:] options := segments[1:]
if len(options) > 0 { if len(options) == 0 {
var fieldOpts fieldOptions return key, nil, nil
}
var fieldOpts fieldOptions
for _, segment := range options { for _, segment := range options {
option := strings.TrimSpace(segment) option := strings.TrimSpace(segment)
switch { switch {
@ -204,9 +206,6 @@ func doParseKeyAndOptions(field reflect.StructField, value string) (string, *fie
return key, &fieldOpts, nil return key, &fieldOpts, nil
} }
return key, nil, nil
}
func implicitValueRequiredStruct(tag string, tp reflect.Type) (bool, error) { func implicitValueRequiredStruct(tag string, tp reflect.Type) (bool, error) {
numFields := tp.NumField() numFields := tp.NumField()
for i := 0; i < numFields; i++ { for i := 0; i < numFields; i++ {

Loading…
Cancel
Save