Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateEmail ¶
func ValidatePhoneNumber ¶
Types ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewWithPhoneRegion ¶ added in v1.0.0
NewWithPhoneRegion builds a Validator whose "phonenumber" struct-tag validator parses numbers against phoneRegion (a libphonenumber region code, e.g. "GH") instead of the hardcoded "NG" default. The underlying ValidatePhoneNumber function has always been region-aware — this was the only call site that hardcoded a region.
A single *validator.Validate instance only supports one registered "phonenumber" region at a time, so a multi-country app validating phone numbers for users in different countries within the same process should construct one Validator per resolved region as needed (e.g. per-request, keyed by the caller's resolved country), rather than relying on a single process-wide default.