Skip to content

Commit

Permalink
Do not validate nested structs when explicitly ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
domenipavec committed Aug 15, 2017
1 parent 15028e8 commit 572eda8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ func ValidateStruct(s interface{}) (bool, error) {
continue // Private field
}
structResult := true
if valueField.Kind() == reflect.Struct {
if valueField.Kind() == reflect.Struct && typeField.Tag.Get(tagName) != "-" {
var err error
structResult, err = ValidateStruct(valueField.Interface())
if err != nil {
Expand Down

0 comments on commit 572eda8

Please sign in to comment.