Skip to content
Myr

Added nil check for embedded structs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jimmy Pettersson · committed by Jimmy Pettersson · parent 45fcd18 · Browse files · 1 file+4 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:binding/binding.go+4 added
174 unmodified lines
175176 if strings.Index(field.Tag.Get("binding"), "required") > -1 {177 fieldType := field.Type.Kind()178 if fieldType == reflect.Struct {179 if reflect.DeepEqual(zero, fieldValue) {180 return errors.New("Required " + field.Name)181 }182183 err := Validate(fieldValue)184 if err != nil {185 return err186 }
23 unmodified lines