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

Loading…
Cancel
Save