FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

adrg/postcode: Small Golang package for validating postal codes · GitHub

/ postcode Public

postcode

Small package for validating 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.

The reason for creating this package is that there is no good regular expression for validating postal codes, and even if it existed, it would have been huge and inefficient.

Full documentation can be found at: https://pkg.go.dev/github.com/adrg/postcode.

Installation

go get github.com/adrg/postcode

Usage

package main

import (
	"github.com/adrg/postcode"
)

func main() {
    if err := postcode.Validate("10007"); err != nil {
        // Treat error.
    }
}

References

For more information see

Contributing

Contributions in the form of pull requests, issues or just general feedback, are always welcome.
See CONTRIBUTING.MD.

License

Copyright (c) 2016 Adrian-George Bostan.

This project is licensed under the MIT license. See LICENSE for more details.

About

Small Golang package for validating postal codes

Topics

Resources

Code of conduct

Contributing

Stars

14 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL