{"id":36814293,"url":"https://github.com/bube054/validatorgo","last_synced_at":"2026-01-12T13:52:02.517Z","repository":{"id":256856784,"uuid":"856633007","full_name":"bube054/validatorgo","owner":"bube054","description":"A Go library of string validators and sanitizers, based on the js library validator.js","archived":false,"fork":false,"pushed_at":"2025-01-11T19:55:54.000Z","size":472,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-03T09:12:15.292Z","etag":null,"topics":["go","golang","input","sanitization","sanitize","validate","validation"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bube054.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-12T23:24:02.000Z","updated_at":"2025-01-11T19:50:15.000Z","dependencies_parsed_at":"2025-01-11T10:22:53.370Z","dependency_job_id":"7c4fca46-885a-48fc-b5b6-615ba0be6db1","html_url":"https://github.com/bube054/validatorgo","commit_stats":null,"previous_names":["bube054/validatorgo"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/bube054/validatorgo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bube054%2Fvalidatorgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bube054%2Fvalidatorgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bube054%2Fvalidatorgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bube054%2Fvalidatorgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bube054","download_url":"https://codeload.github.com/bube054/validatorgo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bube054%2Fvalidatorgo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28339669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","input","sanitization","sanitize","validate","validation"],"created_at":"2026-01-12T13:52:01.741Z","updated_at":"2026-01-12T13:52:02.497Z","avatar_url":"https://github.com/bube054.png","language":"Go","readme":"# validatorgo\n\n\u003c!-- \u003cimg alt=\"Tag\" src=\"https://img.shields.io/badge/tag-v0.1.0-blue?labelColor=gray\"\u003e \u003cimg alt=\"Go Version\" src=\"https://img.shields.io/badge/Go-\u003e=1.13-00ADD8?labelColor=gray\"\u003e \u003cimg alt=\"Reference\" src=\"https://img.shields.io/badge/-reference-00ADD8?logo=go\u0026labelColor=gray\"\u003e \u003cimg alt=\"Tests\" src=\"https://img.shields.io/badge/tests-passing-brightgreen?logo=github\u0026labelColor=gray\"\u003e \u003cimg alt=\"Go Report\" src=\"https://img.shields.io/badge/go_report-A%2B-00ADD8\"\u003e \u003cimg alt=\"Coverage\" src=\"https://img.shields.io/badge/coverage-87.30%25-brightgreen?logo=codecov\"\u003e \u003cimg alt=\"Contributors\" src=\"https://img.shields.io/badge/contributors-1-blueviolet\"\u003e \u003cimg alt=\"License\" src=\"https://img.shields.io/badge/license-MIT-yellow\"\u003e \u003cimg alt=\"Validators\" src=\"https://img.shields.io/badge/validators-88-brightgreen?labelColor=gray\"\u003e \u003cimg alt=\"Sanitizers\" src=\"https://img.shields.io/badge/sanitizers-13-brightgreen?labelColor=gray\"\u003e --\u003e\n\nA library of string validators and sanitizers, based on the js library [validator.js](https://github.com/validatorjs/validator.js)\n\n## Why not use other popular Go libraries?\n\nWhy should not you use other widely known Go libraries like [go-playground/validator](https://github.com/go-playground/validator) or [asaskevich/govalidator](https://github.com/asaskevich/govalidator). The reason is that these libraries primarily focus on validating structs rather than standalone strings. Additionally, they lack a comprehensive library of validators comparable to the original js package [validator.js](https://github.com/validatorjs/validator.js), on which they are based.\n\nI created this project to serve as a dependency for another Go open-source library I developed, called [ginvalidator](https://github.com/bube054/ginvalidator). ginvalidator is designed specifically for validating HTTP requests and acts as the Go equivalent of the popular Node.js/Express library [express-validator](https://express-validator.github.io/docs/).\n\nThe existing libraries in the Go ecosystem were either too complex, not robust enough, or unsuitable for my use case. That’s why I decided to build my own library.\n\n\n## Installation\n\nUsing go get.\n\n```\n go get -u github.com/bube054/validatorgo\n```\n\nThen import the package into your own code.\n\n```go\n import (\n   \"fmt\"\n   \"github.com/bube054/validatorgo\"\n )\n```\n\nIf you are unhappy using the long validatorgo package name, you can do this.\n\n```go\n import (\n   \"fmt\"\n   vgo \"github.com/bube054/validatorgo\"\n )\n```\n\n# Simple validator example\n\n```go\n func main(){\n   id := \"5f2a6c69e1d7a4e0077b4e6b\"\n   validId := vgo.IsMongoID(id)\n   fmt.Println(validId) // true\n }\n```\n\n# Validators\n\nHere is a list of the validators currently available.\n| Validator | Description |\n| -------- | ----------- |\n| **[Contains(str, seed string, opts \\*ContainsOpt)](https://pkg.go.dev/github.com/bube054/validatorgo#Contains)** | A validator that checks if a string contains a seed. `ContainsOpt` defaults to `{ IgnoreCase: false, MinOccurrences: 1 }`. \u003cbr /\u003e **[ContainsOpt](https://pkg.go.dev/github.com/bube054/validatorgo#ContainsOpts):** \u003cbr /\u003e - `IgnoreCase`: Ignore case during comparison (default: `false`). \u003cbr /\u003e - `MinOccurrences`: Minimum number of occurrences for the seed in the string (default: `1`). |\n| **[Equals(str string, comparison string))](https://pkg.go.dev/github.com/bube054/validatorgo#Equals)** | A validator that checks if the string matches the comparison. |\n| **[IsAbaRouting(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsAbaRouting)** | A validator that checks if the string is an ABA routing number for US bank account / cheque. |\n| **[IsAfter(str string, opts \\*IsAfterOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsAfter)** | A validator that checks if the string is a date that is after the specified date. \u003cbr/\u003e `IsAfterOpts` is a struct that defaults to `{ ComparisonDate: \"\" }`. \u003cbr/\u003e `IsAfterOpts`: \u003cbr/\u003e `ComparisonDate`: defaults to the current time. \u003cbr/\u003e string layouts for str and `ComparisonDate` can be different layout. \u003cbr/\u003e these are the only valid layouts from the `time` package e.g `Layout, ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, Kitchen, Stamp, StampMilli, StampMicro, StampNano, DateTime, DateOnly, TimeOnly, StandardDateLayout, SlashDateLayout, DateTimeLayout, ISO8601Layout, ISO8601ZuluLayout, ISO8601WithMillisecondsLayout`. |\n| **[IsAlpha(str string, opts \\*IsAlphaOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsAlpha)** | A validator that checks if the string contains only letters (a-zA-Z). \u003cbr\u003e `IsAlphaOpts` is an optional struct that can be supplied with the following key(s): \u003cbr\u003e `Ignore`: is the string to be ignored e.g. \" -\" will ignore spaces and -'s. \u003cbr\u003e `Locale`: one of `(\"ar\", \"ar-AE\", \"ar-BH\", \"ar-DZ\", \"ar-EG\", \"ar-IQ\", \"ar-JO\", \"ar-KW\", \"ar-LB\", \"ar-LY\", \"ar-MA\", \"ar-QA\", \"ar-QM\", \"ar-SA\", \"ar-SD\", \"ar-SY\", \"ar-TN\", \"ar-YE\", \"bg-BG\", \"bn\", \"cs-CZ\", \"da-DK\", \"de-DE\", \"el-GR\", \"en-AU\", \"en-GB\", \"en-HK\", \"en-IN\", \"en-NZ\", \"en-US\", \"en-ZA\", \"en-ZM\", \"eo\", \"es-ES\", \"fa-IR\", \"fi-FI\", \"fr-CA\", \"fr-FR\", \"he\", \"hi-IN\", \"hu-HU\", \"it-IT\", \"kk-KZ\", \"ko-KR\", \"ja-JP\", \"ku-IQ\", \"nb-NO\", \"nl-NL\", \"nn-NO\", \"pl-PL\", \"pt-BR\", \"pt-PT\", \"ru-RU\", \"si-LK\", \"sl-SI\", \"sk-SK\", \"sr-RS\", \"sr-RS@latin\", \"sv-SE\", \"th-TH\", \"tr-TR\", \"uk-UA\")` and defaults to `en-US` if none is provided. |\n| **[IsAlphanumeric(str string, opts \\*IsAlphanumericOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsAlphanumeric)** |A validator that checks if the string contains only letters and numbers (a-zA-Z0-9). \u003cbr\u003e `IsAlphaOpts` is an optional struct that can be supplied with the following key(s): \u003cbr\u003e `Ignore`: is the string to be ignored e.g. \" -\" will ignore spaces and -'s. \u003cbr\u003e `Locale`: one of `(\"ar\", \"ar-AE\", \"ar-BH\", \"ar-DZ\", \"ar-EG\", \"ar-IQ\", \"ar-JO\", \"ar-KW\", \"ar-LB\", \"ar-LY\", \"ar-MA\", \"ar-QA\", \"ar-QM\", \"ar-SA\", \"ar-SD\", \"ar-SY\", \"ar-TN\", \"ar-YE\", \"bn\", \"bg-BG\", \"cs-CZ\", \"da-DK\", \"de-DE\", \"el-GR\", \"en-AU\", \"en-GB\", \"en-HK\", \"en-IN\", \"en-NZ\", \"en-US\", \"en-ZA\", \"en-ZM\", \"eo\", \"es-ES\", \"fa-IR\", \"fi-FI\", \"fr-CA\", \"fr-FR\", \"he\", \"hi-IN\", \"hu-HU\", \"it-IT\", \"kk-KZ\", \"ko-KR\", \"ja-JP\",\"ku-IQ\", \"nb-NO\", \"nl-NL\", \"nn-NO\", \"pl-PL\", \"pt-BR\", \"pt-PT\", \"ru-RU\", \"si-LK\", \"sl-SI\", \"sk-SK\", \"sr-RS\", \"sr-RS@latin\", \"sv-SE\", \"th-TH\", \"tr-TR\", \"uk-UA\")` and defaults to `en-US` if none is provided. |\n| **[IsArray(str string, opts *IsArrayOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsArray)** | A validator to check that a value is an array. `IsArrayOpts` is a struct which defaults to `{ Min: nil, Max: nil }`. You can also check that the array's length is greater than or equal to `IsArrayOpts.Min` and/or that it's less than or equal to `IsArrayOpts.Max`. |\n| **[IsAscii(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsAscii)** | A validator that checks if the string contains ASCII chars only. |\n| **[IsBase32(str string, opts \\*IsBase32Opts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsBase32)** | A validator that checks if the string is base32 encoded. \u003cbr/\u003e `IsBase32Opts` defaults to `{ Crockford: false }`. When Crockford is true it tests the given base32 encoded string using [crockford's](http://www.crockford.com/base32.html) base32 alternative. |\n| **[IsBase58(str string) bool](https://pkg.go.dev/github.com/bube054/validatorgo#IsBase58)** | A validator that checks if the string is base58 encoded. |\n| **[IsBase64(str string, opts \\*IsBase64Opts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsBase64)** | A validator that checks if the string is base64 encoded. \u003cbr/\u003e `IsBase64Opts` is an optional struct which defaults to `{ UrlSafe: false }`. \u003cbr\u003e When `UrlSafe` is true it tests the given base64 encoded string is [url safe](https://base64.guru/standards/base64url). |\n| **[IsBefore(str string, opts \\*IsBeforeOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsBefore)** | A validator that checks if the string is a date that is before the specified date. \u003cbr/\u003e `IsAfterOpts` is a struct that defaults to `{ ComparisonDate: \"\" }`. \u003cbr/\u003e `IsAfterOpts`: \u003cbr/\u003e `ComparisonDate`: defaults to the current time. \u003cbr/\u003e string layouts for str and `ComparisonDate` can be different layout. \u003cbr/\u003e these are the only valid layouts from the `time` package e.g `Layout, ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, Kitchen, Stamp, StampMilli, StampMicro, StampNano, DateTime, DateOnly, TimeOnly, StandardDateLayout, SlashDateLayout, DateTimeLayout, ISO8601Layout, ISO8601ZuluLayout, ISO8601WithMillisecondsLayout.`. |\n| **[IsBic(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsBic)** | A validator that checks if the string is a BIC (Bank Identification Code) or SWIFT code. |\n| **[IsBoolean(str string, opts \\*IsBooleanOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsBoolean)** | A validator that check if the string is a boolean. |\n| **[IsBTCAddress(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsBTCAddress)** | A validator that checks if the string is a valid BTC address. |\n| **[IsByteLength(str string, opts \\*IsByteLengthOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsByteLength)** | A validator that checks if the string's length (in UTF-8 bytes) falls in a range. \u003cbr/\u003e `IsByteLengthOpts` is a struct which defaults to `{ Min: 0, Max: nil }`. |\n| **[IsCreditCard(str string, opts \\*IsCreditCardOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsCreditCard)** | A validator that checks if the string is a credit card number. \u003cbr/\u003e `IsCreditCardOpts` is an struct that can be supplied with the following key(s): \u003cbr/\u003e `Provider`: is a key whose value should be a string, and defines the company issuing the credit card. Valid values include `amex, bcglobal, carteblanche, dinersclub, discover, instapayment, jcb, koreanlocal, laser, maestro, mastercard, solo, switch, unionpay, visa, visamastercard` or blank will check for any provider. |\n| **[IsCurrency(str string, opts \\*IsCurrencyOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsCurrency)** | A validator that checks if the string is a valid currency amount. \u003cbr/\u003e IsCurrencyOpts is a struct which defaults to `{ Symbol: '$', RequireSymbol: false, AllowSpaceAfterSymbol: false, SymbolAfterDigits: false, AllowNegatives: true, ParensForNegatives: false, NegativeSignBeforeDigits: false, NegativeSignAfterDigits: false, AllowNegativeSignPlaceholder: false, ThousandsSeparator: ',', DecimalSeparator: '.', AllowDecimal: true, RequireDecimal: false, MaxDigitsAfterDecimal: 2, AllowSpaceAfterDigits: false }`.|\n| **[IsDataURI(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsDataURI)** | A validator that checks if the string is a data uri format. |\n| **[IsDate(str string, opts \\*IsDateOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsDate)** | A Validator that checks if the string is a valid date. e.g. 2002-07-15. \u003cbr/\u003e `IsDateOpts` is a struct which can contain the keys `Format`, `StrictMode`. \u003cbr/\u003e Format: is a string and defaults to `validatorgo.StandardDateLayout` if `\"any\"` or no value is provided. \u003cbr/\u003e `StrictMode`: is a boolean and defaults to false. If `StrictMode` is set to true, the validator will reject strings different from Format. |\n| **[IsDecimal(str string, opts \\*IsDecimalOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsDate)** | A validator that check if the string represents a decimal number, such as 0.1, .3, 1.1, 1.00003, 4.0, etc. \u003cbr/\u003e `IsDecimalOpts` is a struct which defaults to `{ForceDecimal: false, DecimalDigits: {Min: 0, Max: nil}, locale: 'en-US'}`. \u003cbr/\u003e `locale`: determines the decimal separator and is one of (\"ar\", \"ar-AE\", \"ar-BH\", \"ar-DZ\", \"ar-EG\", \"ar-IQ\", \"ar-JO\", \"ar-KW\", \"ar-LB\", \"ar-LY\", \"ar-MA\", \"ar-QA\", \"ar-QM\", \"ar-SA\", \"ar-SD\", \"ar-SY\", \"ar-TN\", \"ar-YE\", \"bg-BG\", \"cs-CZ\", \"da-DK\", \"de-DE\", \"el-GR\", \"en-AU\", \"en-GB\", \"en-HK\", \"en-IN\", \"en-NZ\", \"en-US\", \"en-ZA\", \"en-ZM\", \"eo\", \"es-ES\", \"fa\", \"fa-AF\", \"fa-IR\", \"fr-FR\", \"fr-CA\", \"hu-HU\", \"id-ID\", \"it-IT\", \"ku-IQ\", \"nb-NO\", \"nl-NL\", \"nn-NO\", \"pl-PL\", \"pl-Pl\", \"pt-BR\", \"pt-PT\", \"ru-RU\", \"sl-SI\", \"sr-RS\", \"sr-RS@latin\", \"sv-SE\", \"tr-TR\", \"uk-UA\", \"vi-VN\"). `Locale` defaults to `\"en-US\"` \u003cbr/\u003e `ForceDecimal`: simply means a decimal must be present \"123\" will not pass but \"123.45\" will pass \u003cbr/\u003e `DecimalDigits`: is the allowed decimal range e.g `{Min: 3, Max: nil}` 123.456 |\n| **[IsDivisibleBy(str string, num int)](https://pkg.go.dev/github.com/bube054/validatorgo#IsDivisibleBy)** | A validator thats checks if the string is a number(integer not a floating point) that is divisible by another(integer not a floating point). |\n| **[IsEAN(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsEAN)** | IsEAN checks if the string is a valid [EAN](https://en.wikipedia.org/wiki/International_Article_Number) (European Article Number). |\n| **[IsEmail(str string, opts \\*IsEmailOpts)](https://pkg.go.dev/github.com/bube054/validatorgoI#sEmail)** | A validator that checks if the string is an email. \u003cbr/\u003e `IsEmailOpts` is a struct which defaults to `{ AllowDisplayName: false, RequireDisplayName: false, AllowUTF8LocalPart: true, RequireTld: true, AllowIpDomain: false, DomainSpecificValidation: false, BlacklistedChars: \"\", HostBlacklist: [] }`. \u003cbr/\u003e `AllowDisplayName`: if set to true, the validator will also match Display Name \u003cemail-address\u003e. \u003cbr/\u003e `RequireDisplayName`: if set to true, the validator will reject strings without the format Display Name \u003cemail-address\u003e. \u003cbr/\u003e `AllowUTF8LocalPart`: if set to false, the validator will not allow any non-English UTF8 character in email address' local part. \u003cbr/\u003e `RequireTld`: if set to false, email addresses without a TLD in their domain will also be matched. \u003cbr/\u003e `IgnoreMaxLength`: if set to true, the validator will not check for the standard max length of an email. \u003cbr/\u003e `AllowIpDomain`: if set to true, the validator will allow IP addresses in the host part. \u003cbr/\u003e `DomainSpecificValidation`: is true, some additional validation will be enabled, e.g. disallowing certain syntactically valid email addresses that are rejected by Gmail. \u003cbr/\u003e `BlacklistedChars`: receives a string, then the validator will reject emails that include any of the characters in the string, in the name part. \u003cbr/\u003e `HostBlacklist`: if set to an slice of strings and the part of the email after the @ symbol matches one of the strings defined in it, the validation fails. \u003cbr/\u003e`HostWhitelist`: if set to an slice of strings and the part of the email after the @ symbol matches none of the strings defined in it, the validation fails. |\n| **[IsEmpty(str string, opts \\*IsEmptyOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsEmpty)** | A validator check if the string has a length of zero. \u003cbr/\u003e `IsEmptyOpts` is a struct which defaults to `{ IgnoreWhitespace: false }`. |\n| **[IsEthereumAddress(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsEthereumAddress)** | A validator checks if the string is an [Ethereum address](https://ethereum.org/). Does not validate address checksums. |\n| **[IsFloat(str string, opts \\*IsFloatOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsFloat)** | A validator that checks if the string is a float. \u003cbr/\u003e `IsFloatOpts` is a struct which can contain the fields `Min`, `Max`, `Gt`, and/or `Lt` to validate the float is within boundaries it also has `Locale` as an option. \u003cbr/\u003e `Min` and `Max`: are equivalent to 'greater or equal' and 'less or equal' \u003cbr/\u003e `Gt` and `Lt`: are their strict counterparts. \u003cbr/\u003e `Locale` determines the decimal separator and is one of `(\"ar\", \"ar-AE\", \"ar-BH\", \"ar-DZ\", \"ar-EG\", \"ar-IQ\", \"ar-JO\", \"ar-KW\", \"ar-LB\", \"ar-LY\", \"ar-MA\", \"ar-QA\", \"ar-QM\", \"ar-SA\", \"ar-SD\", \"ar-SY\", \"ar-TN\", \"ar-YE\", \"bg-BG\", \"cs-CZ\", \"da-DK\", \"de-DE\", \"en-AU\", \"en-GB\", \"en-HK\", \"en-IN\", \"en-NZ\", \"en-US\", \"en-ZA\", \"en-ZM\", \"eo\", \"es-ES\", \"fr-CA\", \"fr-FR\", \"hu-HU\", \"it-IT\", \"nb-NO\", \"nl-NL\", \"nn-NO\", \"pl-PL\", \"pt-BR\", \"pt-PT\", \"ru-RU\", \"sl-SI\", \"sr-RS\", \"sr-RS@latin\", \"sv-SE\", \"tr-TR\", \"uk-UA\")` |\n| **[IsFQDN(str string, opts \\*IsFQDNOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsFQDN)** | A validator that checks if the string is a fully qualified domain name (e.g. domain.com). \u003cbr\u003e `IsFQDNOpts` is a struct which defaults to `{ RequireTld: true, AllowUnderscores: false, AllowTrailingDot: false, AllowNumericTld: false, allow_wildcard: false, IgnoreMaxLength: false }` |\n| **[IsFreightContainerID(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsFreightContainerID)** | A validator that checks alias for IsISO6346, check if the string is a valid [ISO 6346](https://en.wikipedia.org/wiki/ISO_6346) shipping container identification. \u003cbr/\u003e |\n| **[IsFullWidth(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsFullWidth)** | A validator that checks if the string contains any full-width chars. |\n| **[IsHalfWidth(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsHalfWidth)** | A validator that checks if the string contains any half-width chars. |\n| **[IsHash(str, algorithm string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsHash)** | A validator that checks if the string is a hash of type algorithm. \u003cbr/\u003e `Algorithm` is one of `(\"crc32\", \"crc32b\", \"md4\", \"md5\", \"ripemd128\", \"ripemd160\", \"sha1\", \"sha256\", \"sha384\", \"sha512\", \"tiger128\", \"tiger160\", \"tiger192\")'ripemd128', 'ripemd160', 'sha1', 'sha256', 'sha384', 'sha512', 'tiger128', 'tiger160', 'tiger192')`, No checksum are calculated. |\n| **[IsHexadecimal(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsHexadecimal)** | A validator that checks if the string is a hexadecimal number. |\n| **[IsHexColor(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsHexColor)** | A validator that checks if the string is a hexadecimal color. |\n| **[IsHSL(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsHSL)** | A validator that checks if the string is an HSL (hue, saturation, lightness, optional alpha) color based on CSS Colors Level 4 specification. |\n| **[IsIBAN(str, countryCode string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsIBAN)** | A validator that checks if the string is an IBAN (International Bank Account Number). \u003cbr/\u003e these are the allowed country codes `(\"AD\",\"AE\",\"AL\",\"AT\",\"AZ\",\"BA\",\"BE\",\"BG\",\"BH\",\"BR\",\"BY\",\"CH\",\"CR\",\"CY\",\"CZ\",\"DE\",\"DK\",\"DO\",\"EE\",\"EG\",\"ES\",\"FI\",\"FO\",\"FR\",\"GB\",\"GE\",\"GI\",\"GL\",\"GR\",\"GT\",\"HR\",\"HU\",\"IE\",\"IL\",\"IQ\",\"IR\",\"IS\",\"IT\",\"JO\",\"KW\",\"KZ\",\"LB\",\"LC\",\"LI\",\"LT\",\"LU\",\"LV\",\"MC\",\"MD\",\"ME\",\"MK\",\"MR\",\"MT\",\"MU\",\"MZ\",\"NL\",\"NO\",\"PK\",\"PL\",\"PS\",\"PT\",\"QA\",\"RO\",\"RS\",\"SA\",\"SC\",\"SE\",\"SI\",\"SK\",\"SM\",\"SV\",\"TL\",\"TN\",\"TR\",\"UA\",\"VA\",\"VG\",\"XK\")`. No checksum are calculated. |\n| **[IsIdentityCard(str, locale string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsIdentityCard)** | A validator that checks if the string is a valid identity card code. \u003cbr/\u003e `locale` is one of `(\"LK\", \"PL\", \"ES\", \"FI\", \"IN\", \"IT\", \"IR\", \"MZ\", \"NO\", \"TH\", \"zh-TW\", \"he-IL\", \"ar-LY\", \"ar-TN\", \"zh-CN\", \"zh-HK\", \"PK\")` OR `\"any\"`. If `\"any\"` is used, function will check if any of the locales match. Defaults to `\"any\"` if locale not present. No checksums calculated. |\n| **[IsIMEI(str string, opts \\*IsIMEIOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsIMEI)** | A validator that checks if the string is a valid [IMEI number](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity). IMEI should be of format ############### or ##-######-######-#. \u003cbr/\u003e `IsIMEIOpts` is a struct which can contain the keys `AllowHyphens`. Defaults to first format. \u003cbr/\u003e If `AllowHyphens` is set to true, the validator will validate the second format. |\n| **[IsIn(str string, values []string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsIn)** | A validator that checks if the string is in a slice of allowed values. |\n| **[IsInt(str string, opts \\*IsIntOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsInt)** | A validator that checks if the string is an integer. \u003cbr/\u003e `IsIntOpts` is a struct which can contain the keys `Min` and/or `Max` to check the integer is within boundaries (e.g. `{ Min: nil, Max: nil }`). \u003cbr/\u003e `IsIntOpts` can also contain the key `AllowLeadingZeroes`, which when set to false will disallow integer values with leading zeroes (e.g. `{ AllowLeadingZeroes: false }`). \u003cbr/\u003e Finally, `IsIntOpts` can contain the keys `Gt` and/or `Lt` which will enforce integers being greater than or less than, respectively, the value provided (e.g. `{Gt: ptr(1), Lt: ptr(4)}` for a number between 1 and 4). |\n| **[IsIP(str, version string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsIP)** | A validator that checks if the string is an IP (version 4 or 6). If `version` is not provide, both versions `\"4\"` and `\"6\"` will be checked. |\n| **[IsIPRange(str, version string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsIPRange)** | A validator that checks if the string is an IP Range (version 4 or 6). If `version` is not provide, both versions `\"4\"` and `\"6\"` will be checked. |\n| **[IsISBN(str, version string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsISBN)** | A validator that checks if the string is an [ISBN](https://en.wikipedia.org/wiki/ISBN). \u003cbr/\u003e `version`: ISBN version to compare to. Accepted values are `\"10\"` and `\"13\"`. If none provided, both will be tested. |\n| **[IsISIN(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsISIN)** | A validator that checks if the string is an [ISIN (stock/security identifier)](https://en.wikipedia.org/wiki/International_Securities_Identification_Number). |\n| **[IsIso4217(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsIso4217)** | A validator that checks if the string is a valid [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) officially assigned currency code. |\n| **[IsISO6346(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsISO6346)** | A validator that checks if the string is a valid [ISO 6346](https://en.wikipedia.org/wiki/ISO_6346) shipping container identification. |\n| **[IsISO6391(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsISO6391)** | A validator that checks if the string is a valid [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. |\n| **[IsISO6391(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsISO6391)** | A validator that checks if the string is a valid [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. |\n| **[IsISO8601(str string, opts \\*IsISO8601Opts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsISO8601)** | A validator that checks if the string is a valid [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date. \u003cbr/\u003e`IsISO8601Opts` is a struct which defaults to `{ Strict: false, StrictSeparator: false }`. \u003cbr/\u003e If `Strict` is `true`, date strings with invalid dates like 2009-02-29 will be invalid. \u003cbr/\u003e If `StrictSeparator` is `true`, date strings with date and time separated by anything other than a T will be invalid. |\n| **[IsISO31661Alpha2(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsISO31661Alpha2)** | A validator that checks if the string is a valid [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_4217) officially assigned country code. |\n| **[IsISO31661Alpha3(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsISO31661Alpha3)** | A validator that checks if the string is a valid [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) officially assigned country code. |\n| **[IsISO31661Numeric(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsISO31661Numeric)** | A validator that checks check if the string is a valid [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) numeric officially assigned country code. |\n| **[IsISRC(str string, allowHyphens bool)](https://pkg.go.dev/github.com/bube054/validatorgo#IsISRC)** | A validator that checks if the string is an [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code). \u003cbr/\u003e `allowHyphens` will allow codes with dashes present CC-XXX-YY-NNNNN |\n| **[IsISSN(str string, opts \\*IsISSNOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsISSN)** | A validator that checks if the string is an [ISSN](https://en.wikipedia.org/wiki/International_Standard_Serial_Number). \u003cbr/\u003e `IsISSNOpts` is a struct which defaults to `{ CaseSensitive: false, RequireHyphen: false }`. \u003cbr/\u003e If `CaseSensitive` is `true`, ISSNs with a lowercase `\"x\"` as the check digit are rejected.|\n| **[IsJSON(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsJSON)** | A validator that checks if the string is valid JSON (note: uses `json.Valid()`). |\n| **[IsLatLong(str string, opts \\*IsLatLongOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsLatLong)** | A validator that checks if the string is a valid latitude-longitude coordinate in the format lat,long or lat, long. \u003cbr/\u003e `IsLatLongOpts` is a struct that defaults to `{ CheckDMS: false }`. \u003cbr/\u003e Pass `CheckDMS` as true to validate DMS(degrees, minutes, and seconds) latitude-longitude format. |\n| **[IsLicensePlate(str string, locale string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsLicensePlate)** | A validator that checks if the string matches the format of a country's license plate. \u003cbr\u003e `locale` is one of `(\"cs-CZ\", \"de-DE\", \"de-LI\", \"en-IN\", \"en-SG\", \"en-PK\", \"es-AR\", \"hu-HU\", \"pt-BR\", \"pt-PT\", \"sq-AL\", \"sv-SE\", \"any\")` |\n| **[IsLocale(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsLocale)** | A validator that checks if the string is a locale. |\n| **[IsLowerCase(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsLowerCase)** | A validator that checks if the string is lowercase. |\n| **[IsLuhnNumber(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsLuhnNumber)** | A validator that checks if the string passes the [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) check. |\n| **[IsMacAddress(str string, opts \\*IsMacAddressOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsMacAddress)** | A validator that checks if the string is a MAC address. \u003cbr/\u003e `IsMacAddressOpts` is a struct which defaults to `{ NoSeparators: false, Type: nil }`. \u003cbr/\u003e If `NoSeparators` is `true`, the validator will allow MAC addresses without separators. \u003cbr/\u003e Also, it allows the use of hyphens, spaces or dots e.g. \"01 02 03 04 05 ab\", \"01-02-03-04-05-ab\" or \"0102.0304.05ab\". \u003cbr/\u003e The Type is a pointer to \"48\" or \"64\", defaults to \"48\" |\n| **[IsMagnetURI(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsMagnetURI)** | A validator that checks if the string is a [Magnet URI](https://en.wikipedia.org/wiki/Magnet_URI_scheme) format. |\n| **[IsMailtoURI(str string, opts \\*IsMailToURIOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsMagnetURI)** | A validator that checks if the string is a [Mailto URI](https://en.wikipedia.org/wiki/Mailto) format. \u003cbr/\u003e `IsMailToURIOpts` is a struct that directly embeds `IsEmailOpts`. \u003cbr/\u003e `IsMailToURIOpts` validates emails inside the URI (check `IsEmailOpts` for details). |\n| **[IsMD5(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsMD5)** | A validator that checks if the string is a MD5 hash. \u003cbr/\u003e Please note that you can also use the `isHash(str, \"md5\")` function. \u003cbr/\u003e Keep in mind that MD5 has some collision weaknesses compared to other algorithms (e.g., SHA). |\n| **[IsMimeType(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsMimeType)** | A validator that checks if the string matches to a valid MIME type format. |\n| **[IsMobilePhone(str string, locales []string, opts \\*IsMobilePhoneOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsMobilePhone)** | A validator that checks if the string is a mobile phone number. \u003cbr/\u003e locale is either a slice of locales e.g. `[]string{'sk-SK', 'sr-RS'}` possible options are `(\"am-Am\", \"ar-AE\", \"ar-BH\", \"ar-DZ\", \"ar-EG\", \"ar-EH\", \"ar-IQ\", \"ar-JO\", \"ar-KW\", \"ar-PS\", \"ar-SA\", \"ar-SD\", \"ar-SY\", \"ar-TN\", \"ar-YE\", \"az-AZ\", \"az-LB\", \"az-LY\", \"be-BY\", \"bg-BG\", \"bn-BD\", \"bs-BA\", \"ca-AD\", \"cs-CZ\", \"da-DK\", \"de-AT\", \"de-CH\", \"de-DE\", \"de-LU\", \"dv-MV\", \"dz-BT\", \"el-CY\", \"el-GR\", \"en-AG\", \"en-AI\", \"en-AU\", \"en-BM\", \"en-BS\", \"en-BW\", \"en-CA\", \"en-GB\", \"en-GG\", \"en-GH\", \"en-GY\", \"en-HK\", \"en-IE\", \"en-IN\", \"en-JM\", \"en-KE\", \"en-KI\", \"en-KN\", \"en-LS\", \"en-MO\", \"en-MT\", \"en-MU\", \"en-MW\", \"en-NG\", \"en-NZ\", \"en-PG\", \"en-PH\", \"en-PK\", \"en-RW\", \"en-SG\", \"en-SL\", \"en-SS\", \"en-TZ\", \"en-UG\", \"en-US\", \"en-ZA\", \"en-ZM\", \"en-ZW\", \"es-AR\", \"es-BO\", \"es-CL\", \"es-CO\", \"es-CR\", \"es-CU\", \"es-DO\", \"es-EC\", \"es-ES\", \"es-GT\",\"es-HN\", \"es-MX\", \"es-NI\", \"es-PA\", \"es-PE\", \"es-PY\", \"es-SV\", \"es-UY\", \"es-VE\", \"et-EE\", \"fa-AF\", \"fa-IR\", \"fi-FI\", \"fj-FJ\", \"fo-FO\", \"fr-BE\", \"fr-BF\", \"fr-BJ\", \"fr-CD\", \"fr-CF\", \"fr-FR\", \"fr-GF\", \"fr-GP\", \"fr-MQ\", \"fr-PF\", \"fr-RE\", \"fr-WF\", \"ga-IE\", \"he-IL\", \"hu-HU\", \"id-ID\", \"ir-IR\", \"it-IT\", \"it-SM\", \"ja-JP\", \"ka-GE\", \"kk-KZ\", \"kl-GL\", \"ko-KR\", \"ky-KG\", \"lt-LT\", \"mg-MG\", \"mn-MN\", \"ms-MY\", \"my-MM\", \"mz-MZ\", \"nb-NO\", \"ne-NP\", \"nl-AW\", \"nl-BE\", \"nl-NL\", \"nn-NO\", \"pl-PL\", \"pt-AO\", \"pt-BR\", \"pt-PT\", \"ro-Md\", \"ro-RO\", \"ru-RU\", \"si-LK\", \"sk-SK\", \"sl-SI\", \"so-SO\", \"sq-AL\", \"sr-RS\", \"sv-SE\", \"tg-TJ\", \"th-TH\", \"tk-TM\", \"tr-TR\", \"uk-UA\", \"uz-UZ\", \"vi-VN\", \"zh-CN\", \"zh-HK\", \"zh-MO\", \"zh-TW\")`. If `nil` is provided any of the locales will be matched. If an unidentified value is used, function will return `false`. \u003cbr/\u003e `IsMobilePhoneOpts` is a struct that can be supplied with the following keys: \u003cbr/\u003e `StrictMode`, if this is set to true, the mobile phone number must be supplied with the country code and therefore must start with +. |\n| **[IsMongoID(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsMongoID)** | A validator that checks if the string is a valid hex-encoded representation of a MongoDB ObjectId. |\n| **[IsMultibyte(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsMultibyte)** | A validator that checks if the string contains one or more multibyte chars. |\n| **[IsNumeric(str string, opts \\*IsNumericOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsNumeric)** | A validator that check if a string is a number. \u003cbr/\u003e `IsNumericOpts` is a struct which defaults to `{ NoSymbols: false, Locale: \"\"}`. \u003cbr/\u003e If `NoSymbols` is `true`, the validator will reject numeric strings that feature a symbol (e.g. +, -, or .). \u003cbr/\u003e `Locale` determines the numeric format and is one of `(\"ar\", \"ar-AE\", \"ar-BH\", \"ar-DZ\", \"ar-EG\", \"ar-IQ\", \"ar-JO\", \"ar-KW\", \"ar-LB\", \"ar-LY\", \"ar-MA\", \"ar-QA\", \"ar-QM\", \"ar-SA\", \"ar-SD\", \"ar-SY\", \"ar-TN\", \"ar-YE\", \"bg-BG\", \"cs-CZ\", \"da-DK\", \"de-DE\", \"en-AU\", \"en-GB\", \"en-HK\", \"en-IN\", \"en-NZ\", \"en-US\", \"en-ZA\", \"en-ZM\", \"eo\", \"es-ES\", \"fr-FR\", \"fr-CA\", \"hu-HU\", \"it-IT\", \"nb-NO\", \"nl-NL\", \"nn-NO\", \"pl-PL\", \"pt-BR\", \"pt-PT\", \"ru-RU\", \"sl-SI\", \"sr-RS\", \"sr-RS@latin\", \"sv-SE\", \"tr-TR\", \"uk-UA\")`. `Locale` will default to `\"en-US\"` if not present. |\n| **[F(str string, opts *IsObjectOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsObject)** | A validator to check that a value is a json object. For example, `\"{}\"`, `\"{ foo: 'bar' }\"` would pass this validator. `IsObjectOpts` is a struct which defaults to `{ Strict: true }.` If the `Strict` option is set to `false`, then this validator works, where both arrays (`\"[]\"`) and the null (`\"null\"`) value are considered objects. |\n| **[IsOctal(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsOctal)** | A validator that checks if the string is a valid octal number. |\n| **[IsPassportNumber(str, countryCode string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsPassportNumber)** | A validator that checks if the string is a valid passport number. \u003cbr/\u003e `countryCode` is one of `(\"AM\", \"AR\", \"AT\", \"AU\", \"AZ\", \"BE\", \"BG\", \"BY\", \"BR\", \"CA\", \"CH\", \"CN\", \"CY\", \"CZ\", \"DE\", \"DK\", \"DZ\", \"EE\", \"ES\", \"FI\", \"FR\", \"GB\", \"GR\", \"HR\", \"HU\", \"IE\", \"IN\", \"IR\", \"ID\", \"IS\", \"IT\", \"JM\", \"JP\", \"KR\", \"KZ\", \"LI\", \"LT\", \"LU\", \"LV\", \"LY\", \"MT\", \"MX\", \"MY\", \"MZ\", \"NL\", \"NZ\", \"PH\", \"PK\", \"PL\", \"PT\", \"RO\", \"RU\", \"SE\", \"SL\", \"SK\", \"TH\", \"TR\", \"UA\", \"US\", \"ZA\")`. |\n| **[IsPort(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsPort)** | A validator that checks if the string is a valid port number. |\n| **[IsPostalCode(str, locale string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsPostalCode)** | A validator that checks if the string is a postal code. \u003cbr/\u003e `locale` is one of `(\"AD\", \"AT\", \"AU\", \"AZ\", \"BA\", \"BE\", \"BG\", \"BR\", \"BY\", \"CA\", \"CH\", \"CN\", \"CO\", \"CZ\", \"DE\", \"DK\", \"DO\", \"DZ\", \"EE\", \"ES\", \"FI\", \"FR\", \"GB\", \"GR\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IN\", \"IR\", \"IS\", \"IT\", \"JP\", \"KE\", \"KR\", \"LI\", \"LK\", \"LT\", \"LU\", \"LV\", \"MG\", \"MT\", \"MX\", \"MY\", \"NL\", \"NO\", \"NP\", \"NZ\", \"PL\", \"PR\", \"PT\", \"RO\", \"RU\", \"SA\", \"SE\", \"SG\", \"SI\", \"SK\", \"TH\", \"TN\", \"TW\", \"UA\", \"US\", \"ZA\", \"ZM\")`. If `\"any\"` or no locale is used, function will check if any of the locales match. |\n| **[IsRFC3339(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsRFC3339)** | A validator that checks if the string is a valid [RFC 3339](https://tools.ietf.org/html/rfc3339) date. |\n| **[IsRgbColor(str string, opts \\*IsRgbOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsRgbColor)** |A validator that checks if the string is a rgb or rgba color. \u003cbr/\u003e `IsRgbOpts` is a struct with the following properties: \u003cbr/\u003e `IncludePercentValues` defaults to `false`. If you don't want to allow to set rgb or rgba values with percents, like rgb(5%,5%,5%), or rgba(90%,90%,90%,.3), then set it to `false`. \u003cbr/\u003e `AllowSpaces` defaults to `false`, which prohibits whitespace. If set to `false`, whitespace between color values is allowed, such as rgb(255, 255, 255) or even rgba(255, 128, 0, 0.7). |\n| **[IsSemVer(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsSemVer)** | A validator that checks if the string is a Semantic Versioning Specification (SemVer). |\n| **[IsSlug(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsSlug)** | A validator that checks if the string is of type slug. |\n| **[IsStrongPassword(str string, opts \\*IsStrongPasswordOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsStrongPassword)** | A validator that checks if the string can be considered a strong password or not. Returns the validity and the score. \u003cbr/\u003e Default `IsStrongPasswordOpts`: `{ MinLength: 8, MinLowercase: 1, MinUppercase: 1, MinNumbers: 1, MinSymbols: 1,  PointsPerUnique: 1, PointsPerRepeat: 0.5, PointsForContainingLower: 10, PointsForContainingUpper: 10, PointsForContainingNumber: 10, PointsForContainingSymbol: 10 }`, note all values here are pointers. |\n| **[IsSurrogatePair(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsSurrogatePair)** | A validator that checks if the string contains any surrogate pairs chars. |\n| **[IsTaxID(str, locale string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsTaxID)** | A validator that checks if the string is a valid Tax Identification Number. Defaults locale is \"en-US\" and \"any\" will match any of them. \u003cbr/\u003e Supported `locales`: `(\"bg-BG\", \"cs-CZ\", \"de-AT\", \"de-DE\", \"dk-DK\", \"el-CY\", \"el-GR\", \"en-CA\", \"en-GB\", \"en-IE\", \"en-US\", \"es-AR\", \"es-ES\", \"et-EE\", \"fi-FI\", \"fr-BE\", \"fr-CA\", \"fr-FR\", \"fr-LU\", \"hr-HR\", \"hu-HU\", \"it-IT\", \"lb-LU\", \"lt-LT\", \"lv-LV\", \"mt-MT\", \"nl-BE\", \"nl-NL\", \"pl-PL\", \"pt-BR\", \"pt-PT\", \"ro-RO\", \"sk-SK\", \"sl-SI\", \"sv-SE\", \"uk-UA\")`. \u003cbr/\u003e |\n| **[IsTime(str string, opts IsTimeOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsTime)** | A validator that checks if the string is a valid time e.g. 23:01:59. \u003cbr/\u003e `IsTimeOpts` is a struct which can contain the keys `HourFormat` and `Mode`. \u003cbr/\u003e `HourFormat` is a key and defaults to `\"hour24\"`. \u003cbr/\u003e `Mode` is a key and defaults to `\"default\"`. \u003cbr/\u003e `HourFormat` can contain the values `\"hour12\"` or `\"hour24\"`, `\"hour24\"` will validate hours in 24 format and `\"hour12\"` will validate hours in 12 format. \u003cbr/\u003e `Mode` can contain the values `\"default\"` or `\"withSeconds\"`, `\"default\"` will validate HH:MM or HH:MM:SS format, `\"withSeconds\"` will validate only HH:MM:SS format. |\n| **[IsULID(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsULID)** | A validator that checks if the string is a [ULID](https://github.com/ulid/spec). |\n| **[IsUpperCase(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsUpperCase)** | A validator that checks if the string is uppercase. |\n| **[IsURL(str string, opts \\*IsURLOpts)](https://pkg.go.dev/github.com/bube054/validatorgo#IsURL)** | A validator that checks if the string is a URL. \u003cbr/\u003e `IsURLOpts` is a struct which defaults to `{ Protocols: []string{\"https\",\"http\",\"ftp\"}, RequireTld: true, RequireProtocol: false, RequireHost: true, RequirePort: false, RequireValidProtocol: true, AllowUnderscores: false, HostWhitelist: nil, HostBlacklist: nil, AllowTrailingDot: false, AllowProtocolRelativeUrls: true, AllowFragments: true, AllowQueryComponents: true, DisallowAuth: false, ValidateLength: true, MaxAllowedLength:: 2048 }`. \u003cbr/\u003e `RequireProtocol` - if set to true IsURL will return false if protocol is not present in the URL. \u003cbr/\u003e `RequireValidProtocol` - IsURL will check if the URL's protocol is present in the protocols option. \u003cbr/\u003e `protocols` - valid protocols can be modified with this option. \u003cbr/\u003e `RequireHost` - if set to false IsURL will not check if host is present in the URL. \u003cbr/\u003e `RequirePort` - if set to true IsURL will check if port is present in the URL. \u003cbr/\u003e `AllowProtocolRelativeUrls` - if set to true protocol relative URLs will be allowed. \u003cbr/\u003e `AllowFragments` - if set to false IsURL will return false if fragments are present. |\n| **[IsUUID(str, version string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsUUID)** | A validator that checks if the string is an RFC9562 UUID. \u003cbr/\u003e version is one of (\"1\"-\"5\"). if none is not provided, it will validate any of them. \u003cbr/\u003e AllowQueryComponents - if set to false IsURL will return false if query components are present. \u003cbr/\u003e `ValidateLength` - if set to false IsURL will skip string length validation. MaxAllowedLength will be ignored if this is set as false. \u003cbr/\u003e `MaxAllowedLength` - if set IsURL will not allow URLs longer than the specified value (default is 2084 that IE maximum URL length). |\n| **[IsVariableWidth(str string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsVariableWidth)** | A validator that checks if the string contains a mixture of full and half-width chars. |\n| **[IsVAT(str, countryCode string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsVAT)** | A validator that checks if the string is a valid VAT number if validation is available for the given country code matching ISO 3166-1 alpha-2. \u003cbr/\u003e `countryCode` is one of `(\"AL\", \"AR\", \"AT\", \"AU\", \"BE\", \"BG\", \"BO\", \"BR\", \"BY\", \"CA\", \"CH\", \"CL\", \"CO\", \"CR\", \"CY\", \"CZ\", \"DE\", \"DK\", \"DO\", \"EC\", \"EE\", \"EL\", \"ES\", \"FI\", \"FR\", \"GB\", \"GT\", \"HN\", \"HR\", \"HU\", \"ID\", \"IE\", \"IL\", \"IN\", \"IS\", \"IT\", \"KZ\", \"LT\", \"LU\", \"LV\", \"MK\", \"MT\", \"MX\", \"NG\", \"NI\", \"NL\", \"NO\", \"NZ\", \"PA\", \"PE\", \"PH\", \"PL\", \"PT\", \"PY\", \"RO\", \"RS\", \"RU\", \"SA\", \"SE\", \"SI\", \"SK\", \"SM\", \"SV\", \"TR\", \"UA\", \"UY\", \"UZ\", \"VE\")`. If no value or `\"any\"` is provided will match every one. |\n| **[IsWhitelisted(str, chars string)](https://pkg.go.dev/github.com/bube054/validatorgo#IsWhitelisted)** | A validator that checks if the string consists only of characters that appear in the whitelist chars. |\n| **[Matches(str string, re \\*regexp.Regexp)](https://pkg.go.dev/github.com/bube054/validatorgo#IsWhitelisted)** | A validator that checks if the string matches the regex. |\n\n\u003e **⚠ Caution**  \n\u003e When using a validator that requires an options struct (either a pointer or non-pointer), always provide values for all the struct fields explicitly.\n\u003e Unlike in [validator.js](https://github.com/validatorjs/validator.js), where missing fields are automatically set to defaults, Go uses strict types.\n\u003e This means missing values will default to false for booleans, 0 for number types, etc.\n\u003e Not specifying all fields could lead to unexpected behavior if you're used to the JavaScript version.\n\nExamples\n\n```go\n  // do this (using the default options specified in the docs)\n  ok := validatorgo.IsFQDN(\"example\", nil)\n\n  // or this (explicitly setting all possible fields for the structs)\n  ok := validatorgo.IsFQDN(\"example\", \u0026validatorgo.IsFQDNOpts{\n    RequireTld: false,\n    AllowUnderscores: false,\n    AllowTrailingDot: true,\n    AllowNumericTld: false,\n    IgnoreMaxLength: true\n  })\n\n  // but rarely this(not explicitly setting all possible fields)\n  ok := validatorgo.IsFQDN(\"example\", \u0026validatorgo.IsFQDNOpts{ RequireTld: false, })\n```\n\n# Simple sanitizer example\n\n```go\n  import (\n   \"fmt\"\n   \"github.com/bube054/validatorgo/sanitizer\"\n )\n\n func main(){\n   str := sanitizer.Whitelist(\"Hello123 World!\", \"a-zA-Z\")\n   fmt.Println(str) // \"HelloWorld\"\n }\n```\n\n# Sanitizers\n\nHere is a list of the sanitizers currently available.\n| Sanitizer | Description |\n|:----------|:------------|\n| **[Blacklist(str, blacklistedChars string)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#Blacklist)** | A sanitizer that remove characters that appear in the blacklist. \u003cbr/\u003e The characters are used in a RegExp and will escaped for you. |\n| **[Escape(str string)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#Escape)** | A sanitizer that replaces \u003c, \u003e, \u0026, ' and \". with HTML entities.|\n| **[LTrim(str, chars string)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#LTrim)** | A sanitizer that trims characters (whitespace by default) from the left-side of the input. |\n| **[NormalizeEmail(email string, opts \\*NormalizeEmailOpts)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#NormalizeEmail)** | A sanitizer that canonicalizes an email address. (This doesn't validate that the input is an email, if you want to validate the email use `IsEmail` beforehand). \u003cbr/\u003e `NormalizeEmailOpts` is a struct with the following keys and default values: \u003cbr/\u003e `AllLowercase`: `true` - Transforms the local part (before the @ symbol) of all email addresses to lowercase. Please note that this may violate RFC 5321, which gives providers the possibility to treat the local part of email addresses in a case sensitive way (although in practice most - yet not all - providers don't). The domain part of the email address is always lowercased, as it is case insensitive per RFC 1035. \u003cbr/\u003e `GmailLowercase`: `true` - Gmail addresses are known to be case-insensitive, so this switch allows lowercasing them even when AllLowercase is set to `false`. Please note that when AllLowercase is `true`, Gmail addresses are lowercased regardless of the value of this setting. \u003cbr/\u003e `GmailRemoveDots`: true: Removes dots from the local part of the email address, as Gmail ignores them (e.g. \"john.doe\" and \"johndoe\" are considered equal). \u003cbr/\u003e `GmailRemoveSubaddress`: `true`: Normalizes addresses by removing \"sub-addresses\", which is the part following a \"+\" sign (e.g. \"foo+bar@gmail.com\" becomes \"foo@gmail.com\"). \u003cbr/\u003e `GmailConvertGooglemaildotcom`: true: Converts addresses with domain @googlemail.com to @gmail.com, as they're equivalent. \u003cbr/\u003e `OutlookdotcomLowercase`: `true` - Outlook.com addresses (including Windows Live and Hotmail) are known to be case-insensitive, so this switch allows lowercasing them even when AllLowercase is set to `false`. Please note that when AllLowercase is `true`, Outlook.com addresses are lowercased regardless of the value of this setting. \u003cbr/\u003e `OutlookdotcomRemoveSubaddress`: `true`: Normalizes addresses by removing \"sub-addresses\", which is the part following a \"+\" sign (e.g. \"foo+bar@outlook.com\" becomes \"foo@outlook.com\"). \u003cbr/\u003e `YahooLowercase`: `true` - Yahoo Mail addresses are known to be case-insensitive, so this switch allows lowercasing them even when AllLowercase is set to `false`. Please note that when AllLowercase is `true`, Yahoo Mail addresses are lowercased regardless of the value of this setting. \u003cbr/\u003e `YahooRemoveSubaddress`: `true`: Normalizes addresses by removing \"sub-addresses\", which is the part following a \"-\" sign (e.g. \"foo-bar@yahoo.com\" becomes \"foo@yahoo.com\"). \u003cbr/\u003e `IcloudLowercase`: `true` - iCloud addresses (including MobileMe) are known to be case-insensitive, so this switch allows lowercasing them even when AllLowercase is set to false. Please note that when AllLowercase is true, iCloud addresses are lowercased regardless of the value of this setting. \u003cbr/\u003e `IcloudRemoveSubaddress`: `true`: Normalizes addresses by removing \"sub-addresses\", which is the part following a \"+\" sign (e.g. \"foo+bar@icloud.com\" becomes \"foo@icloud.com\"). |\n| **[RTrim(str, chars string)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#RTrim)** | A sanitizer that trims characters (whitespace by default) from the right-side of the input. |\n| **[StripLow(str string, keepNewLines bool)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#StripLow)** | sanitizer that removes characters with a numerical value \u003c `32` and `127`, mostly control characters. \u003cbr/\u003e If `keepNewLines` is true, newline characters are preserved (\\n and \\r, hex 0xA and 0xD). |\n| **[ToBoolean(str string, strict bool)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#ToBoolean)** | A sanitizer that converts the input string to a boolean. \u003cbr/\u003e Everything except for `\"0\"`, `\"false\"` and `\"\"` returns `true`. \u003cbr/\u003e In strict mode only `\"1\"` and `\"true\"` return `true`. |\n| **[ToDate(str string)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#ToDate)** | A sanitizer that converts the input string to a pointer to `time.Time`, if the input is not of a time layout returns a nil pointer. e.g `(Layout, ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, Kitchen, Stamp, StampMilli, StampMicro, StampNano, DateTime, DateOnly, TimeOnly)` |\n| **[ToFloat(str string)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#ToFloat)** | A sanitizer that converts the input string to a float64 and also returns an error if the input is not a float. |\n| **[ToInt(str string)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#ToInt)** | A sanitizer that converts the input string to an int and also returns an error if the input is not a int. (Beware of octals) |\n| **[Trim(str, chars string)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#Trim)** | A sanitizer that trim characters (whitespace by default) from both sides of the input. |\n| **[Unescape(str string)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#Unescape)** | A sanitizer that replaces HTML encoded entities with \u003c, \u003e, \u0026, ', \", `, \\ and /. |\n| **[Whitelist(str, whitelistedChars string)](https://pkg.go.dev/github.com/bube054/validatorgo/sanitizer#Whitelist)** | A sanitizer that removes characters that do not appear in the whitelist. \u003cbr/\u003e The characters are used in a RegExp and will escaped for you. |\n\n# Maintainers\n\n- [bube054](https://github.com/bube054) - **Attah Gbubemi David (author)**\n\n\u003c!-- # Other related projects\n\n- [ginvalidator](https://github.com/bube054/ginvalidator)\n- [echovalidator](https://github.com/bube054/echovalidator)\n- [fibervalidator](https://github.com/bube054/fibervalidator)\n- [chivalidator](https://github.com/bube054/chivalidator) --\u003e\n\n# License\n\nThis project is licensed under the [MIT](https://opensource.org/license/mit). See the [LICENSE](https://github.com/bube054/validatorgo/blob/master/LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbube054%2Fvalidatorgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbube054%2Fvalidatorgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbube054%2Fvalidatorgo/lists"}