Skip to content

Suggestion working differently in Verify and SuggestDomain functions #101

@mardu

Description

@mardu
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions