asaskevich / govalidator

[Go] Package of validators and sanitizers for strings, numerics, slices and structs
MIT License
6k stars 556 forks source link

IsExistingEmail("john@cashin.ca") is returning False #448

Closed khanakia closed 3 years ago

khanakia commented 3 years ago

Bug Report

Q A
Version(s) v0.0.0-20210307081110-f21760c49a8d

Summary

This code is not working and returns false

package main

import (
    "fmt"

    "github.com/asaskevich/govalidator"
)

func main() {
    fmt.Println(govalidator.IsExistingEmail("john@doe.ca"))
}

Current behavior

Returns False but should return TRUE

How to reproduce

Playground: https://play.golang.org/p/Sw2aR6bg_jG

Expected behavior

Should return TRUE

khanakia commented 3 years ago

I figured it out isEmail uses the MX lookup and fails so i used fmt.Println(govalidator.IsEmail("john@doe.ca")) and it worked.