Documentation ¶
Overview ¶
Package postcode validates postal codes. While the validation process does not guarantee that the postcode actually exists, it does guarantee that the format of the provided input is valid.
For more information see: https://en.wikipedia.org/wiki/List_of_postal_codes https://en.wikipedia.org/wiki/ISO_3166-1
Example
if err := postcode.Validate("10007"); err != nil { // the postcode is not valid // treat error }
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmpty = errors.New("postal code cannot be empty") ErrShort = errors.New("postal code cannot be shorter than 2 characters") ErrInvalidCountry = errors.New("invalid country code") ErrInvalidFormat = errors.New("invalid postal code format") )
Possible validation errors.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.