Skip to content

Commit 73945b6

Browse files
authored
Merge pull request #217 from matematik7/master
Do not validate nested structs when explicitly ignored
2 parents 15028e8 + 572eda8 commit 73945b6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

validator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ func ValidateStruct(s interface{}) (bool, error) {
595595
continue // Private field
596596
}
597597
structResult := true
598-
if valueField.Kind() == reflect.Struct {
598+
if valueField.Kind() == reflect.Struct && typeField.Tag.Get(tagName) != "-" {
599599
var err error
600600
structResult, err = ValidateStruct(valueField.Interface())
601601
if err != nil {

0 commit comments

Comments
 (0)