An email validator package for Golang
- For regex used, see https://emailregex.com/
strict
mode coming soon
import (
"github.com/H-Richard/truemail"
)
func main() {
//Validate only format
v:= truemail.Validator{}
fmt.PrintLn(v.Validate("[email protected]"))
}
func main() {
//Validate both format and domain
v := truemail.Validator{Domains: []string{"pm.me"}}
fmt.PrintLn(v.Validate("[email protected]"))
}