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.