diff --git a/README.md b/README.md index 6c14bbf..419c46f 100644 --- a/README.md +++ b/README.md @@ -455,8 +455,8 @@ The following code implements the aforementioned examples: ```go result := validation.ValidateStruct(&a, validation.Field(&a.Unit, validation.When(a.Quantity != "", validation.Required).Else(validation.Nil)), - validation.Field(&a.Phone, validation.When(a.Email == "", validation.Required.Error('Either phone or Email is required.')), - validation.Field(&a.Email, validation.When(a.Phone == "", validation.Required.Error('Either phone or Email is required.')), + validation.Field(&a.Phone, validation.When(a.Email == "", validation.Required.Error("Either phone or Email is required.")), + validation.Field(&a.Email, validation.When(a.Phone == "", validation.Required.Error("Either phone or Email is required.")), ) ``` @@ -467,8 +467,8 @@ The above code can also be simplified using the shortcut `validation.Required.Wh ```go result := validation.ValidateStruct(&a, validation.Field(&a.Unit, validation.Required.When(a.Quantity != ""), validation.Nil.When(a.Quantity == "")), - validation.Field(&a.Phone, validation.Required.When(a.Email == "").Error('Either phone or Email is required.')), - validation.Field(&a.Email, validation.Required.When(a.Phone == "").Error('Either phone or Email is required.')), + validation.Field(&a.Phone, validation.Required.When(a.Email == "").Error("Either phone or Email is required.")), + validation.Field(&a.Email, validation.Required.When(a.Phone == "").Error("Either phone or Email is required.")), ) ```