Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion working differently in Verify and SuggestDomain functions #101

Open
mardu opened this issue Aug 24, 2023 · 0 comments
Open

Suggestion working differently in Verify and SuggestDomain functions #101

mardu opened this issue Aug 24, 2023 · 0 comments

Comments

@mardu
Copy link

mardu commented Aug 24, 2023

package main

import (
	"fmt"
	emailverifier "github.com/AfterShip/email-verifier"
)

func main() {
	verifier := emailverifier.
		NewVerifier().
		EnableDomainSuggest()

	ret, _ := verifier.Verify("[email protected]")
	fmt.Println("Suggestion 1: ", ret.Suggestion)

	suggestion := verifier.SuggestDomain(ret.Syntax.Domain)
	fmt.Println("Suggestion 2: ", suggestion)
}

Real result

Suggestion 1: 
Suggestion 2:  gmail.com

Expected result:

Suggestion 1:  gmail.com
Suggestion 2:  gmail.com

These two examples should have the same results however the Verify function results an empty suggestion while SuggestDomain function works as expected.

However testing the same code with this example [email protected] has the same result with both cases:

Suggestion 1:  gmal.com
Suggestion 2:  gmal.com

Tested with Go version 1.21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant