From 3daca8b331e151485c3b785a60e539bf332bcf7e Mon Sep 17 00:00:00 2001
From: dudaodong
Date: Wed, 30 Aug 2023 14:25:12 +0800
Subject: [PATCH] doc: update validator doc
---
docs/api/packages/validator.md | 90 +++++++++++++++----------------
docs/en/api/packages/validator.md | 68 +++++++++++------------
2 files changed, 79 insertions(+), 79 deletions(-)
diff --git a/docs/api/packages/validator.md b/docs/api/packages/validator.md
index daf4ca5..83470ba 100644
--- a/docs/api/packages/validator.md
+++ b/docs/api/packages/validator.md
@@ -71,7 +71,7 @@ import (
func ContainChinese(s string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/7DpU0uElYeM)
```go
import (
@@ -105,7 +105,7 @@ func main() {
func ContainLetter(str string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/lqFD04Yyewp)
```go
import (
@@ -139,7 +139,7 @@ func main() {
func ContainLower(str string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/Srqi1ItvnAA)
```go
import (
@@ -173,7 +173,7 @@ func main() {
func ContainUpper(str string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/CmWeBEk27-z)
```go
import (
@@ -207,7 +207,7 @@ func main() {
func IsAlpha(s string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/7Q5sGOz2izQ)
```go
import (
@@ -241,7 +241,7 @@ func main() {
func IsAllUpper(str string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/ZHctgeK1n4Z)
```go
import (
@@ -275,7 +275,7 @@ func main() {
func IsAllLower(str string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/GjqCnOfV6cM)
```go
import (
@@ -309,7 +309,7 @@ func main() {
func IsASCII(str string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/hfQNPLX0jNa)
```go
import (
@@ -349,7 +349,7 @@ func main() {
func IsBase64(base64 string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/sWHEySAt6hl)
```go
import (
@@ -380,7 +380,7 @@ func main() {
func IsChineseMobile(mobileNum string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/GPYUlGTOqe3)
```go
import (
@@ -411,7 +411,7 @@ func main() {
func IsChineseIdNum(id string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/d8EWhl2UGDF)
```go
import (
@@ -442,7 +442,7 @@ func main() {
func IsChinesePhone(phone string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/RUD_-7YZJ3I)
```go
import (
@@ -473,7 +473,7 @@ func main() {
func IsCreditCard(creditCart string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/sNwwL6B0-v4)
```go
import (
@@ -504,7 +504,7 @@ func main() {
func IsDns(dns string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/jlYApVLLGTZ)
```go
import (
@@ -538,7 +538,7 @@ func main() {
func IsEmail(email string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/Os9VaFlT33G)
```go
import (
@@ -569,7 +569,7 @@ func main() {
func IsEmptyString(s string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/dpzgUjFnBCX)
```go
import (
@@ -603,7 +603,7 @@ func main() {
func IsInt(v any) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/eFoIHbgzl-z)
```go
import (
@@ -640,7 +640,7 @@ func main() {
func IsFloat(v any) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/vsyG-sxr99_Z)
```go
import (
@@ -669,7 +669,7 @@ func main() {
### IsNumber
-验证参数是否是数字(integer or float)
+验证参数是否是数字(integer or float)。
函数签名:
@@ -677,7 +677,7 @@ func main() {
func IsNumber(v any) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/mdJHOAvtsvF)
```go
import (
@@ -707,7 +707,7 @@ func main() {
### IsIntStr
-验证字符串是否是可以转换为整数
+验证字符串是否是可以转换为整数。
函数签名:
@@ -715,7 +715,7 @@ func main() {
func IsIntStr(s string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/jQRtFv-a0Rk)
```go
import (
@@ -744,7 +744,7 @@ func main() {
### IsFloatStr
-验证字符串是否是可以转换为浮点数
+验证字符串是否是可以转换为浮点数。
函数签名:
@@ -752,7 +752,7 @@ func main() {
func IsFloatStr(s string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/LOYwS_Oyl7U)
```go
import (
@@ -781,7 +781,7 @@ func main() {
### IsNumberStr
-验证字符串是否是可以转换为数字
+验证字符串是否是可以转换为数字。
函数签名:
@@ -789,7 +789,7 @@ func main() {
func IsNumberStr(s string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/LzaKocSV79u)
```go
import (
@@ -818,7 +818,7 @@ func main() {
### IsJSON
-验证字符串是否是有效json
+验证字符串是否是有效json。
函数签名:
@@ -826,7 +826,7 @@ func main() {
func IsJSON(str string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/8Kip1Itjiil)
```go
import (
@@ -855,7 +855,7 @@ func main() {
### IsRegexMatch
-验证字符串是否可以匹配正则表达式
+验证字符串是否可以匹配正则表达式。
函数签名:
@@ -863,7 +863,7 @@ func main() {
func IsRegexMatch(s, regex string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/z_XeZo_litG)
```go
import (
@@ -888,7 +888,7 @@ func main() {
### IsIp
-验证字符串是否是ip地址
+验证字符串是否是ip地址。
函数签名:
@@ -896,7 +896,7 @@ func main() {
func IsIp(ipstr string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/FgcplDvmxoD)
```go
import (
@@ -925,7 +925,7 @@ func main() {
### IsIpV4
-验证字符串是否是ipv4地址
+验证字符串是否是ipv4地址。
函数签名:
@@ -933,7 +933,7 @@ func main() {
func IsIpV4(ipstr string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/zBGT99EjaIu)
```go
import (
@@ -956,7 +956,7 @@ func main() {
### IsIpV6
-验证字符串是否是ipv6地址
+验证字符串是否是ipv6地址。
函数签名:
@@ -964,7 +964,7 @@ func main() {
func IsIpV6(ipstr string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/AHA0r0AzIdC)
```go
import (
@@ -987,7 +987,7 @@ func main() {
### IsStrongPassword
-验证字符串是否是强密码:(alpha(lower+upper) + number + special chars(!@#$%^&*()?><))
+验证字符串是否是强密码:(alpha(lower+upper) + number + special chars(!@#$%^&*()?><))。
函数签名:
@@ -995,7 +995,7 @@ func main() {
func IsStrongPassword(password string, length int) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/QHdVcSQ3uDg)
```go
import (
@@ -1018,7 +1018,7 @@ func main() {
### IsUrl
-验证字符串是否是url
+验证字符串是否是url。
函数签名:
@@ -1026,7 +1026,7 @@ func main() {
func IsUrl(str string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/pbJGa7F98Ka)
```go
import (
@@ -1053,7 +1053,7 @@ func main() {
### IsWeakPassword
验证字符串是否是弱密码:(only letter or only number or letter + number)
-.
+。
函数签名:
@@ -1061,7 +1061,7 @@ func main() {
func IsWeakPassword(password string, length int) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/wqakscZH5gH)
```go
import (
@@ -1092,7 +1092,7 @@ func main() {
func IsZeroValue(value any) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/UMrwaDCi_t4)
```go
import (
@@ -1129,7 +1129,7 @@ func main() {
func IsGBK(data []byte) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/E2nt3unlmzP)
```go
import (
@@ -1162,7 +1162,7 @@ func main() {
func IsPrintable(str string) bool
```
-示例:
+示例:[Run](https://go.dev/play/p/Pe1FE2gdtTP)
```go
import (
diff --git a/docs/en/api/packages/validator.md b/docs/en/api/packages/validator.md
index 58a5df0..48ab3f8 100644
--- a/docs/en/api/packages/validator.md
+++ b/docs/en/api/packages/validator.md
@@ -72,7 +72,7 @@ import (
func ContainChinese(s string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/7DpU0uElYeM)
```go
import (
@@ -106,7 +106,7 @@ func main() {
func ContainLetter(str string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/lqFD04Yyewp)
```go
import (
@@ -140,7 +140,7 @@ func main() {
func ContainLower(str string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/Srqi1ItvnAA)
```go
import (
@@ -174,7 +174,7 @@ func main() {
func ContainUpper(str string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/CmWeBEk27-z)
```go
import (
@@ -208,7 +208,7 @@ func main() {
func IsAlpha(s string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/7Q5sGOz2izQ)
```go
import (
@@ -242,7 +242,7 @@ func main() {
func IsAllUpper(str string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/ZHctgeK1n4Z)
```go
import (
@@ -276,7 +276,7 @@ func main() {
func IsAllLower(str string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/GjqCnOfV6cM)
```go
import (
@@ -310,7 +310,7 @@ func main() {
func IsASCII(str string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/hfQNPLX0jNa)
```go
import (
@@ -350,7 +350,7 @@ func main() {
func IsBase64(base64 string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/sWHEySAt6hl)
```go
import (
@@ -381,7 +381,7 @@ func main() {
func IsChineseMobile(mobileNum string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/GPYUlGTOqe3)
```go
import (
@@ -412,7 +412,7 @@ func main() {
func IsChineseIdNum(id string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/d8EWhl2UGDF)
```go
import (
@@ -443,7 +443,7 @@ func main() {
func IsChinesePhone(phone string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/RUD_-7YZJ3I)
```go
import (
@@ -474,7 +474,7 @@ func main() {
func IsCreditCard(creditCart string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/sNwwL6B0-v4)
```go
import (
@@ -505,7 +505,7 @@ func main() {
func IsDns(dns string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/jlYApVLLGTZ)
```go
import (
@@ -539,7 +539,7 @@ func main() {
func IsEmail(email string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/Os9VaFlT33G)
```go
import (
@@ -570,7 +570,7 @@ func main() {
func IsEmptyString(s string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/dpzgUjFnBCX)
```go
import (
@@ -604,7 +604,7 @@ func main() {
func IsInt(v any) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/eFoIHbgzl-z)
```go
import (
@@ -641,7 +641,7 @@ func main() {
func IsFloat(v any) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/vsyG-sxr99_Z)
```go
import (
@@ -678,7 +678,7 @@ func main() {
func IsNumber(v any) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/mdJHOAvtsvF)
```go
import (
@@ -715,7 +715,7 @@ func main() {
func IsIntStr(s string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/jQRtFv-a0Rk)
```go
import (
@@ -752,7 +752,7 @@ func main() {
func IsFloatStr(s string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/LOYwS_Oyl7U)
```go
import (
@@ -789,7 +789,7 @@ func main() {
func IsNumberStr(s string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/LzaKocSV79u)
```go
import (
@@ -826,7 +826,7 @@ func main() {
func IsJSON(str string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/8Kip1Itjiil)
```go
import (
@@ -863,7 +863,7 @@ func main() {
func IsRegexMatch(s, regex string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/z_XeZo_litG)
```go
import (
@@ -894,7 +894,7 @@ func main() {
func IsIp(ipstr string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/FgcplDvmxoD)
```go
import (
@@ -931,7 +931,7 @@ func main() {
func IsIpV4(ipstr string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/zBGT99EjaIu)
```go
import (
@@ -962,7 +962,7 @@ func main() {
func IsIpV6(ipstr string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/AHA0r0AzIdC)
```go
import (
@@ -985,7 +985,7 @@ func main() {
### IsStrongPassword
-Check if the string is strong password (alpha(lower+upper) + number + special chars(!@#$%^&*()?><)).
+Check if the string is strong password (alpha(lower+upper) + number + special chars(!@#$%^&*()?gt<)).
Signature:
@@ -993,7 +993,7 @@ func main() {
func IsStrongPassword(password string, length int) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/QHdVcSQ3uDg)
```go
import (
@@ -1024,7 +1024,7 @@ func main() {
func IsUrl(str string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/pbJGa7F98Ka)
```go
import (
@@ -1059,7 +1059,7 @@ func main() {
func IsWeakPassword(password string, length int) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/wqakscZH5gH)
```go
import (
@@ -1090,7 +1090,7 @@ func main() {
func IsZeroValue(value any) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/UMrwaDCi_t4)
```go
import (
@@ -1127,7 +1127,7 @@ func main() {
func IsGBK(data []byte) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/E2nt3unlmzP)
```go
import (
@@ -1159,7 +1159,7 @@ func main() {
func IsPrintable(str string) bool
```
-Example:
+Example:[运行](https://go.dev/play/p/Pe1FE2gdtTP)
```go
import (