Skip to content

Commit

Permalink
Merge pull request #217 from matematik7/master
Browse files Browse the repository at this point in the history
Do not validate nested structs when explicitly ignored
  • Loading branch information
asaskevich committed Sep 3, 2017
2 parents 15028e8 + 572eda8 commit 73945b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion validator.go
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 73945b6

Please sign in to comment.