Skip to content

Commit a43209a

Browse files
committed
docs: update docs
1 parent d226abd commit a43209a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,23 @@ import (
4646
"github.com/mkafonso/schema/pkg/validator"
4747
)
4848

49-
func ValidateStringExample() {
50-
input := "Luna"
49+
func ValidateEmailExample() {
50+
input := "[email protected]"
5151

5252
// Defining a validation schema
5353
stringValidator := validator.NewStringValidator().
54-
MinLength(5, "The string must be at least 5 characters long"). // Sets minimum length constraint
55-
MaxLength(50, "The string must be at most 50 characters long") // Sets maximum length constraint
54+
MinLength(5, "A string deve ter no mínimo 5 caracteres"). // Sets minimum length constraint
55+
MaxLength(50, "A string deve ter no máximo 50 caracteres"). // Sets maximum length constraint
56+
IsEmail("Formato de email inválido") // Validates as an email format
5657

5758
// Validating the input
5859
result := stringValidator.Validate(input)
5960

6061
// Handling validation result
6162
if result.IsValid {
62-
fmt.Println("String validation successful!") // Message for successful validation
63+
fmt.Println("Validation successful!") // Message for successful validation
6364
} else {
64-
fmt.Println("String validation error:", result.Errors) // Printing validation errors
65+
fmt.Println("Validation error:", result.Errors) // Printing validation errors
6566
}
6667
}
6768
```

0 commit comments

Comments
 (0)