Documentation
¶
Index ¶
- func IsAlpha(s string) bool
- func IsAlphanumeric(s string) bool
- func IsCreditCard(s string) bool
- func IsEmail(s string) bool
- func IsEmailAddr(s string) bool
- func IsHexColor(s string) bool
- func IsIP(s string) bool
- func IsIPv4(s string) bool
- func IsJSON(s string) bool
- func IsLatitude(lat float64) bool
- func IsLongitude(lng float64) bool
- func IsMAC(s string) bool
- func IsMatch(s string, pattern string) bool
- func IsNumeric(s string) bool
- func IsPhone(s string) bool
- func IsPort(port int) bool
- func IsPostalCode(s string) bool
- func IsPrivateIP(s string) bool
- func IsURL(s string) bool
- func IsUUID(s string) bool
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAlphanumeric ¶
func IsCreditCard ¶ added in v1.2.0
Example ¶
fmt.Println(IsCreditCard("4111111111111111"))
fmt.Println(IsCreditCard("1234567890123456"))
Output: true false
func IsEmailAddr ¶
func IsHexColor ¶ added in v1.2.0
func IsJSON ¶ added in v1.2.0
Example ¶
fmt.Println(IsJSON(`{"key":"value"}`))
fmt.Println(IsJSON(`{invalid}`))
Output: true false
func IsLatitude ¶ added in v1.2.0
func IsLongitude ¶ added in v1.2.0
func IsPostalCode ¶ added in v1.2.0
func IsPrivateIP ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.