Documentation ¶
Overview ¶
Package emailaddress parses and validates emails addresses, using the standard library's net/mail package. The goal of the package is to never classify a valid email address as invalid; this is in contrast to the overly strict email address validation behavior often seen on the Internet.
This package at its core uses the net/mail package for parsing. The net/mail package appears to classify certain email addresses that are invalid according to RFCs and Wikipedia as valid. The same behavior is seen from this package as well.
The net/mail package only provides an interface to parse addresses of the form "Barry Gibbs <[email protected]>" (name and email address). This package provides an interface to parse and validate addresses without the name part (i.e. of the form "[email protected]").
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValid ¶
IsValid returns whether the email address is of valid format. It is a shorthand for the piece of code:
_, _, err := Parse(email) return err != nil
Most callers will want to use strings.TrimSpace(email) before invoking this function.
Types ¶
This section is empty.