Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.
/ check Public archive

Check is a library written in Go to help "check" if values are correct such as credit card numbers, email addresses, phone numbers, etc.

License

Notifications You must be signed in to change notification settings

polds/check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

check

Validation Library for Go. API Documentation on go.pkgdoc.org. Inspiration and partial port from is.js

go get github.com/polds/check

To check if a credit card is a valid card

check.CreditCard("4111111111111111").CardIs("Any") // Returns true

To validate if a card is a specific type of card (Supported cards: American Express, Visa, Discover, Mastercard)

check.CreditCard("4111111111111111").CardIs("MasterCard") // Returns false

To determine the merchant of credit card

check.CreditCard("4111111111111111").Merchant() // Returns Visa

To validate an email address

check.Email("test@test.com").IsValid() // Returns true

To validate if a provided zip code matches a target country standard

check.Zip("83406").OfCountry("us") // Returns true
  • Email regex fails: user@[IPv6:2001:db8:1ff::a0b:dbd0], postbox@com, admin@mailserver1. Besides those examples, regex is RFC compliant.

About

Check is a library written in Go to help "check" if values are correct such as credit card numbers, email addresses, phone numbers, etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages