Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
euskadi31 committed Mar 11, 2024
1 parent 2cd559d commit 1578338
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions email_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (v emailValidator) Validate(input interface{}) error {
case string:
addr, err := mail.ParseAddress(email)
if err != nil {
return err
return fmt.Errorf("parse address: %w", err)
}

parts := strings.Split(addr.Address, "@")
Expand All @@ -45,7 +45,7 @@ func (v emailValidator) Validate(input interface{}) error {
defer cancel()

if _, err := net.DefaultResolver.LookupMX(ctx, parts[1]); err != nil {
return err
return fmt.Errorf("lookup mx: %w", err)
}

default:
Expand Down
4 changes: 2 additions & 2 deletions uuid_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ func (v uuidValidator) Validate(input interface{}) error {
switch val := input.(type) {
case string:
if _, err := uuid.Parse(val); err != nil {
return err
return fmt.Errorf("parse UUID: %w", err)
}
case []byte:
if _, err := uuid.FromBytes(val); err != nil {
return err
return fmt.Errorf("parse UUID from bytes: %w", err)
}
default:
return fmt.Errorf("invalid input type \"%v\" for UUID validator", reflect.TypeOf(val))
Expand Down

0 comments on commit 1578338

Please sign in to comment.