8000 GitHub - gilesvangruisen/emailx: Email validation/normalization for golang
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gilesvangruisen/emailx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

emailx

Golang pkg for email validation and normalization.

GoDoc Travis

Email validation

  • Simple email format check (not a complicated regexp, this is why)
  • Resolve the host name
import "github.com/goware/emailx"

func main() {
    err := emailx.Validate("My+Email@wrong.example.com")
    if err != nil {
        fmt.Println("Email is not valid.")

        if err == emailx.ErrInvalidFormat {
            fmt.Println("Wrong format.")
        }

        if err == emailx.ErrUnresolvableHost {
            fmt.Println("Unresolvable host.")
        }
    }
}

Email normalization

import 
5440
"github.com/goware/emailx"

func main() {
    fmt.Print(emailx.Normalize(" My+Email@example.com. "))
    // Prints my+email@example.com
}

License

Emailx is licensed under the MIT License.

About

Email validation/normalization for golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%
0