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