diff --git a/README.md b/README.md
index c3a16bb..95f28bc 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
![Go version](https://img.shields.io/badge/go-%3E%3Dv1.18-9cf)
-[![Release](https://img.shields.io/badge/release-2.3.3-green.svg)](https://github.com/duke-git/lancet/releases)
+[![Release](https://img.shields.io/badge/release-2.3.4-green.svg)](https://github.com/duke-git/lancet/releases)
[![GoDoc](https://godoc.org/github.com/duke-git/lancet/v2?status.svg)](https://pkg.go.dev/github.com/duke-git/lancet/v2)
[![Go Report Card](https://goreportcard.com/badge/github.com/duke-git/lancet/v2)](https://goreportcard.com/report/github.com/duke-git/lancet/v2)
[![test](https://github.com/duke-git/lancet/actions/workflows/codecov.yml/badge.svg?branch=main&event=push)](https://github.com/duke-git/lancet/actions/workflows/codecov.yml)
@@ -39,7 +39,7 @@
go get github.com/duke-git/lancet/v2 // will install latest version of v2.x.x
```
-2. For users who use version below go1.18, you should install v1.x.x. The latest of v1.x.x is v1.4.4.
+2. For users who use version below go1.18, you should install v1.x.x. The latest of v1.x.x is v1.4.5.
```go
go get github.com/duke-git/lancet // below go1.18, install latest version of v1.x.x
@@ -321,12 +321,19 @@ import "github.com/duke-git/lancet/v2/convertor"
[[play](https://go.dev/play/p/OphmHCN_9u8)]
- **ToStdBase64** : converts a value to a string encoded in standard Base64.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToStdBase64)]
+ [[play](https://go.dev/play/p/_fLJqJD3NMo)]
- **ToUrlBase64** : converts a value to a string encoded in url Base64.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToUrlBase64)]
+ [[play](https://go.dev/play/p/C_d0GlvEeUR)]
- **ToRawStdBase64** : converts a value to a string encoded in raw standard Base64.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToRawStdBase64)]
+ [[play](https://go.dev/play/p/wSAr3sfkDcv)]
- **ToRawUrlBase64** : converts a value to a string encoded in raw url Base64.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToRawUrlBase64)]
+ [[play](https://go.dev/play/p/HwdDPFcza1O)]
+- **ToBigInt** : converts an integer of any supported type (int, int64, uint64, etc.) to *big.Int.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToBigInt)]
+ [[play](https://go.dev/play/p/todo)]
6. Cryptor package is for data encryption and decryption. index
@@ -475,7 +482,12 @@ import "github.com/duke-git/lancet/v2/cryptor"
- **RsaDecryptOAEP** : decrypts the data with RSA-OAEP
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#RsaDecryptOAEP)]
[[play](https://go.dev/play/p/sSVmkfENKMz)]
-
+- **RsaSign** : signs the data with RSA.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#RsaSign)]
+ [[play](https://go.dev/play/p/todo)]
+- **RsaVerifySign** : verifies the signature of the data with RSA.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#RsaVerifySign)]
+ [[play](https://go.dev/play/p/todo)]
7. Datetime package supports date and time format and compare. index
@@ -619,7 +631,15 @@ import "github.com/duke-git/lancet/v2/datetime"
- **GenerateDatetimesBetween** : returns a slice of strings between two times.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#GenerateDatetimesBetween)]
[[play](https://go.dev/play/p/6kHBpAxD9ZC)]
-
+- **Min** : returns the earliest time among the given times.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#Min)]
+ [[play](https://go.dev/play/p/todo)]
+- **Max** : returns the latest time among the given times.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#Max)]
+ [[play](https://go.dev/play/p/todo)]
+- **MaxMin** : returns the latest and earliest time among the given times.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#MaxMin)]
+ [[play](https://go.dev/play/p/todo)]
8. Datastructure package contains some common data structure. eg. list, linklist, stack, queue, set, tree, graph. index
@@ -755,6 +775,9 @@ import "github.com/duke-git/lancet/v2/fileutil"
- **ParallelChunkRead** : reads the file in parallel and send each chunk of lines to the specified channel.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#ParallelChunkRead)]
[[play](https://go.dev/play/p/teMXnCsdSEw)]
+- **GetExeOrDllVersion** : Get the version of exe or dll file on windows os.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#GetExeOrDllVersion)]
+ [[play](https://go.dev/play/p/todo)]
@@ -1120,7 +1143,18 @@ import "github.com/duke-git/lancet/v2/mathutil"
- **Div** : returns the result of x divided by y.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Div)]
[[play](https://go.dev/play/p/WLxDdGXXYat)]
-
+- **Variance** : returns the variance of numbers.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Variance)]
+ [[play](https://go.dev/play/p/todo)]
+- **StdDev** : returns the standard deviation of numbers.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#StdDev)]
+ [[play](https://go.dev/play/p/todo)]
+- **Permutation** : calculates P(n, k).
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Permutation)]
+ [[play](https://go.dev/play/p/todo)]
+- **Combination** : calculates C(n, k).
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Combination)]
+ [[play](https://go.dev/play/p/todo)]
14. Netutil package contains functions to get net information and send http request. index
@@ -1281,7 +1315,9 @@ import "github.com/duke-git/lancet/v2/random"
- **RandSliceFromGivenSlice** : generate a random slice of length num from given slice.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/random.md#RandSliceFromGivenSlice)]
[[play](https://go.dev/play/p/68UikN9d6VT)]
-
+- **RandNumberOfLength** : generates a random int number of specified length.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/random.md#RandNumberOfLength)]
+ [[play](https://go.dev/play/p/todo)]
17. Retry package is for executing a function repeatedly until it was successful or canceled by the context. index
@@ -1575,7 +1611,12 @@ import "github.com/duke-git/lancet/v2/slice"
- **Frequency** : counts the frequency of each element in the slice.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Frequency)]
[[play](https://go.dev/play/p/CW3UVNdUZOq)]
-
+- **JoinFunc** : joins the slice elements into a single string with the given separator.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#JoinFunc)]
+ [[play](https://go.dev/play/p/todo)]
+- **ConcatBy** : concats the elements of a slice into a single value using the provided separator and connector function.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#ConcatBy)]
+ [[play](https://go.dev/play/p/todo)]
19. Stream package implements a sequence of elements supporting sequential and operations. this package is an experiment to explore if stream in go can work as the way java does. its function is very limited. index
@@ -1666,6 +1707,12 @@ import "github.com/duke-git/lancet/v2/stream"
- **ToSlice** : returns the elements in the stream.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#ToSlice)]
[[play](https://go.dev/play/p/jI6_iZZuVFE)]
+- **IndexOf** : returns the index of the first occurrence of the specified element in this stream.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#IndexOf)]
+ [[play](https://go.dev/play/p/todo)]
+- **LastIndexOf** : returns the index of the last occurrence of the specified element in this stream.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#LastIndexOf)]
+ [[play](https://go.dev/play/p/todo)]
20. Structs package provides several high level functions to manipulate struct, tag, and field. index
@@ -1847,6 +1894,9 @@ import "github.com/duke-git/lancet/v2/strutil"
- **RegexMatchAllGroups** : matches all subgroups in a string using a regular expression and returns the result.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#RegexMatchAllGroups)]
[[play](https://go.dev/play/p/JZiu0RXpgN-)]
+- **ExtractContent** : extracts the content between the start and end strings in the source string.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#ExtractContent)]
+ [[play](https://go.dev/play/p/todo)]
22. System package contain some functions about os, runtime, shell command. index
@@ -2197,6 +2247,9 @@ import "github.com/duke-git/lancet/v2/xerror"
- **TryUnwrap** : check if err is nil then it returns a valid value. If err is not nil, TryUnwrap panics with err.
[[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#TryUnwrap)]
[[play](https://go.dev/play/p/acyZVkNZEeW)]
+- **TryCatch** : simple simulation of Java-style try-catch.
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#TryCatch)]
+ [[play](https://go.dev/play/p/todo)]
## How to Contribute
diff --git a/README_zh-CN.md b/README_zh-CN.md
index f112ca3..a416fe3 100644
--- a/README_zh-CN.md
+++ b/README_zh-CN.md
@@ -4,7 +4,7 @@
![Go version](https://img.shields.io/badge/go-%3E%3Dv1.18-9cf)
-[![Release](https://img.shields.io/badge/release-2.3.3-green.svg)](https://github.com/duke-git/lancet/releases)
+[![Release](https://img.shields.io/badge/release-2.3.4-green.svg)](https://github.com/duke-git/lancet/releases)
[![GoDoc](https://godoc.org/github.com/duke-git/lancet/v2?status.svg)](https://pkg.go.dev/github.com/duke-git/lancet/v2)
[![Go Report Card](https://goreportcard.com/badge/github.com/duke-git/lancet/v2)](https://goreportcard.com/report/github.com/duke-git/lancet/v2)
[![test](https://github.com/duke-git/lancet/actions/workflows/codecov.yml/badge.svg?branch=main&event=push)](https://github.com/duke-git/lancet/actions/workflows/codecov.yml)
@@ -38,7 +38,7 @@
go get github.com/duke-git/lancet/v2 //安装v2最新版本v2.x.x
```
-2. 使用 go1.18 以下版本的用户,必须安装 v1.x.x。目前最新的 v1 版本是 v1.4.4。
+2. 使用 go1.18 以下版本的用户,必须安装 v1.x.x。目前最新的 v1 版本是 v1.4.5。
```go
go get github.com/duke-git/lancet// 使用go1.18以下版本, 必须安装v1.x.x版本
@@ -321,13 +321,19 @@ import "github.com/duke-git/lancet/v2/convertor"
[[play](https://go.dev/play/p/OphmHCN_9u8)]
- **ToStdBase64** : 将值转换为StdBase64编码的字符串。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToStdBase64)]
+ [[play](https://go.dev/play/p/_fLJqJD3NMo)]
- **ToUrlBase64** : 将值转换为url Base64编码的字符串。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToUrlBase64)]
+ [[play](https://go.dev/play/p/C_d0GlvEeUR)]
- **ToRawStdBase64** : 将值转换为RawStdBase64编码的字符串。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToRawStdBase64)]
+ [[play](https://go.dev/play/p/wSAr3sfkDcv)]
- **ToRawUrlBase64** : 将值转换为RawUrlBase64编码的字符串。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToRawUrlBase64)]
-
+ [[play](https://go.dev/play/p/HwdDPFcza1O)]
+- **ToBigInt** : 将整数转为*big.Int。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToBigInt)]
+ [[play](https://go.dev/play/p/todo)]
6. cryptor 加密包支持数据加密和解密,获取 md5,hash 值。支持 base64, md5, hmac, aes, des, rsa。 回到目录
@@ -477,7 +483,12 @@ import "github.com/duke-git/lancet/v2/cryptor"
- **RsaDecryptOAEP** : rsa OAEP解密。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#RsaDecryptOAEP)]
[[play](https://go.dev/play/p/sSVmkfENKMz)]
-
+- **RsaSign** : 应用RSA算法签名数据。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#RsaSign)]
+ [[play](https://go.dev/play/p/todo)]
+- **RsaVerifySign** : 验证数据的签名是否符合RSA算法。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#RsaVerifySign)]
+ [[play](https://go.dev/play/p/todo)]
7. datetime日期时间处理包,格式化日期,比较日期。 回到目录
@@ -622,6 +633,15 @@ import "github.com/duke-git/lancet/v2/datetime"
- **GenerateDatetimesBetween** : 生成从start到end的所有日期时间的字符串列表。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#GenerateDatetimesBetween)]
[[play](https://go.dev/play/p/6kHBpAxD9ZC)]
+- **Min** : 返回最早时间。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#Min)]
+ [[play](https://go.dev/play/p/todo)]
+- **Max** : 返回最晚时间。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#Max)]
+ [[play](https://go.dev/play/p/todo)]
+- **MaxMin** : 返回最早和最晚时间。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#MaxMin)]
+ [[play](https://go.dev/play/p/todo)]
8. datastructure 包含一些普通的数据结构实现。例如:list, linklist, stack, queue, set, tree, graph。 回到目录
@@ -754,7 +774,9 @@ import "github.com/duke-git/lancet/v2/fileutil"
- **ParallelChunkRead** : 并行读取文件并将每个块的行发送到指定通道。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#ParallelChunkRead)]
[[play](https://go.dev/play/p/teMXnCsdSEw)]
-
+- **GetExeOrDllVersion** : 返回exe,dll文件版本号(仅Window平台)。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#GetExeOrDllVersion)]
+ [[play](https://go.dev/play/p/todo)]
@@ -1121,7 +1143,18 @@ import "github.com/duke-git/lancet/v2/mathutil"
- **Div** : 除法运算。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Div)]
[[play](https://go.dev/play/p/WLxDdGXXYat)]
-
+- **Variance** : 计算方差。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Variance)]
+ [[play](https://go.dev/play/p/todo)]
+- **StdDev** : 计算标准差。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#StdDev)]
+ [[play](https://go.dev/play/p/todo)]
+- **Permutation** : 计算排列数P(n, k)。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Permutation)]
+ [[play](https://go.dev/play/p/todo)]
+- **Combination** : 计算组合数C(n, k)。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Combination)]
+ [[play](https://go.dev/play/p/todo)]
14. netutil 网络包支持获取 ip 地址,发送 http 请求。 回到目录
@@ -1282,7 +1315,9 @@ import "github.com/duke-git/lancet/v2/random"
- **RandSliceFromGivenSlice** : 从给定切片中生成长度为 num 的随机切片。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/random.md#RandSliceFromGivenSlice)]
[[play](https://go.dev/play/p/68UikN9d6VT)]
-
+- **RandNumberOfLength** : 生成指定长度的随机数。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/random.md#RandNumberOfLength)]
+ [[play](https://go.dev/play/p/todo)]
17. retry 重试执行函数直到函数运行成功或被 context cancel。 回到目录
@@ -1301,7 +1336,7 @@ import "github.com/duke-git/lancet/v2/retry"
- **RetryFunc** : 重试执行的函数。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/retry.md#RetryFunc)]
[[play](https://go.dev/play/p/nk2XRmagfVF)]
-- **RetryTimes** : 设置重试次数,默认 5。
+- **RetryTimes** : 设置重试次数,默认5。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/retry.md#RetryTimes)]
[[play](https://go.dev/play/p/ssfVeU2SwLO)]
- **BackoffStrategy** : 定义计算退避间隔的方法的接口。
@@ -1573,7 +1608,12 @@ import "github.com/duke-git/lancet/v2/slice"
- **Frequency** : 计算切片中每个元素出现的频率。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Frequency)]
[[play](https://go.dev/play/p/CW3UVNdUZOq)]
-
+- **JoinFunc** : 将切片元素用给定的分隔符连接成一个单一的字符串。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#JoinFunc)]
+ [[play](https://go.dev/play/p/todo)]
+- **ConcatBy** : 将切片中的元素连接成一个值,使用指定的分隔符和连接器函数。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#ConcatBy)]
+ [[play](https://go.dev/play/p/todo)]
19. stream 流,该包仅验证简单的 stream 实现,功能有限。 回到目录
@@ -1664,7 +1704,12 @@ import "github.com/duke-git/lancet/v2/stream"
- **ToSlice** : 返回 stream 中的元素切片。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#ToSlice)]
[[play](https://go.dev/play/p/jI6_iZZuVFE)]
-
+- **IndexOf** : 返回在stream中找到值的第一个匹配项的索引,如果找不到值,则返回-1。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#IndexOf)]
+ [[play](https://go.dev/play/p/todo)]
+- **LastIndexOf** : 返回在stream中找到值的最后一个匹配项的索引,如果找不到值,则返回-1。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#LastIndexOf)]
+ [[play](https://go.dev/play/p/todo)]
20. structs 提供操作 struct, tag, field 的相关函数。 回到目录
@@ -1849,6 +1894,9 @@ import "github.com/duke-git/lancet/v2/strutil"
- **RegexMatchAllGroups** : 使用正则表达式匹配字符串中的所有子组并返回结果。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#RegexMatchAllGroups)]
[[play](https://go.dev/play/p/JZiu0RXpgN-)]
+- **ExtractContent** : 提取两个标记之间的内容。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#ExtractContent)]
+ [[play](https://go.dev/play/p/todo)]
22. system 包含 os, runtime, shell command 的相关函数。 回到目录
@@ -2061,7 +2109,7 @@ import "github.com/duke-git/lancet/v2/validator"
- **IsCreditCard** : 验证字符串是否是信用卡号码。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsCreditCard)]
[[play](https://go.dev/play/p/sNwwL6B0-v4)]
-- **IsDns** : 验证字符串是否是有效 dns。
+- **IsDns** : 验证字符串是否是有效dns。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsDns)]
[[play](https://go.dev/play/p/jlYApVLLGTZ)]
- **IsEmail** : 验证字符串是否是有效电子邮件地址。
@@ -2097,10 +2145,10 @@ import "github.com/duke-git/lancet/v2/validator"
- **IsIp** : 验证字符串是否是 ip 地址。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsIp)]
[[play](https://go.dev/play/p/FgcplDvmxoD)]
-- **IsIpV4** : 验证字符串是否是 ipv4 地址。
+- **IsIpV4** : 验证字符串是否是ipv4地址。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsIpV4)]
[[play](https://go.dev/play/p/zBGT99EjaIu)]
-- **IsIpV6** : 验证字符串是否是 ipv6 地址。
+- **IsIpV6** : 验证字符串是否是ipv6地址。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsIpV6)]
[[play](https://go.dev/play/p/AHA0r0AzIdC)]
- **IsStrongPassword** : 验证字符串是否是强密码:(字母+数字+特殊字符)。
@@ -2115,10 +2163,10 @@ import "github.com/duke-git/lancet/v2/validator"
- **IsZeroValue** : 判断传入的参数值是否为零值。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsZeroValue)]
[[play](https://go.dev/play/p/UMrwaDCi_t4)]
-- **IsGBK** : 检查数据编码是否为 gbk(汉字内部代码扩展规范)。
+- **IsGBK** : 检查数据编码是否为gbk(汉字内部代码扩展规范)。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsGBK)]
[[play](https://go.dev/play/p/E2nt3unlmzP)]
-- **IsASCII** : 验证字符串全部为 ASCII 字符。
+- **IsASCII** : 验证字符串全部为ASCII字符。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsASCII)]
[[play](https://go.dev/play/p/hfQNPLX0jNa)]
- **IsPrintable** : 检查字符串是否全部为可打印字符。
@@ -2133,13 +2181,13 @@ import "github.com/duke-git/lancet/v2/validator"
- **IsBase64URL** : 检查字符串是否是有效的 base64 url。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsBase64URL)]
[[play](https://go.dev/play/p/vhl4mr8GZ6S)]
-- **IsJWT** : 检查字符串是否是有效的 JSON Web Token (JWT)。
+- **IsJWT** : 检查字符串是否是有效的JSON Web Token (JWT)。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsJWT)]
[[play](https://go.dev/play/p/R6Op7heJbKI)]
-- **IsVisa** : 检查字符串是否是有效的 visa 卡号。
+- **IsVisa** : 检查字符串是否是有效的visa卡号。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsVisa)]
[[play](https://go.dev/play/p/SdS2keOyJsl)]
-- **IsMasterCard** : 检查字符串是否是有效的 MasterCard 卡号。
+- **IsMasterCard** : 检查字符串是否是有效的MasterCard卡号。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsMasterCard)]
[[play](https://go.dev/play/p/CwWBFRrG27b)]
- **IsAmericanExpress** : 检查字符串是否是有效的 American Express 卡号。
@@ -2175,30 +2223,33 @@ import "github.com/duke-git/lancet/v2/xerror"
- **XError_Unwrap** : 解构 XEerror 为 error 对象。适配 github.com/pkg/errors。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Unwrap)
[[play](https://go.dev/play/p/VUXJ8BST4c6)]
-- **XError_With** : 添加与 XError 对象的键和值。
+- **XError_With** : 添加与XError对象的键和值。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_With)]
[[play](https://go.dev/play/p/ow8UISXX_Dp)]
-- **XError_Id** : 设置 XError 对象的 id。
+- **XError_Id** : 设置XError对象的id。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Id)]
[[play](https://go.dev/play/p/X6HBlsy58U9)]
-- **XError_Is** : 检查目标 error 是否为 XError,两个错误中的 error.id 是否匹配。
+- **XError_Is** : 检查目标error是否为XError,两个错误中的error.id是否匹配。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Is)]
[[play](https://go.dev/play/p/X6HBlsy58U9)]
-- **XError_Values** : 返回由 With 设置的键和值的映射。将合并所有 XError 键和值。
+- **XError_Values** : 返回由With设置的键和值的映射。将合并所有XError键和值。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Values)]
[[play](https://go.dev/play/p/ow8UISXX_Dp)]
-- **XError_StackTrace** : 返回与 pkg/error 兼容的堆栈信息。
+- **XError_StackTrace** : 返回与pkg/error兼容的堆栈信息。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_StackTrace)]
[[play](https://go.dev/play/p/6FAvSQpa7pc)]
-- **XError_Info** : 返回可打印的 XError 对象信息。
+- **XError_Info** : 返回可打印的XError对象信息。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Info)]
[[play](https://go.dev/play/p/1ZX0ME1F-Jb)]
-- **XError_Error** : 实现标准库的 error 接口。
+- **XError_Error** : 实现标准库的error接口。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Error)]
[[play](https://go.dev/play/p/w4oWZts7q7f)]
-- **TryUnwrap** : 检查 error, 如果 err 为 nil 则展开,则它返回一个有效值,如果 err 不是 nil 则 Unwrap 使用 err 发生 panic。
+- **TryUnwrap** : 检查error, 如果err为nil则展开,则它返回一个有效值,如果err不是nil则Unwrap使用err发生panic。
[[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#TryUnwrap)]
[[play](https://go.dev/play/p/acyZVkNZEeW)]
+- **TryCatch** : 简单实现的java风格异常处理(try-catch-finally)。
+ [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#TryCatch)]
+ [[play](https://go.dev/play/p/todo)]
## 如何贡献代码
diff --git a/datastructure/tree/bstree_test.go b/datastructure/tree/bstree_test.go
index 6d22890..6071661 100644
--- a/datastructure/tree/bstree_test.go
+++ b/datastructure/tree/bstree_test.go
@@ -100,12 +100,6 @@ func TestBSTree_Delete(t *testing.T) {
acturl1 := bstree.InOrderTraverse()
assert.Equal([]int{2, 5, 6, 7}, acturl1)
-
- //todo
- // bstree.DeletetNode(6, comparator)
- // bstree.Print()
- // acturl2 := bstree.InOrderTraverse()
- // assert.Equal([]int{2, 5, 7}, acturl2)
}
func TestBSTree_Depth(t *testing.T) {
diff --git a/docs/api/packages/mathutil.md b/docs/api/packages/mathutil.md
index ff9389b..40bce9c 100644
--- a/docs/api/packages/mathutil.md
+++ b/docs/api/packages/mathutil.md
@@ -1236,7 +1236,7 @@ func main() {
### Permutation
-计算排列数(P(n, k))。
+计算排列数P(n, k)。
函数签名:
@@ -1269,7 +1269,7 @@ func main() {
### Combination
-计算组合数(C(n, k))。
+计算组合数C(n, k)。
函数签名:
diff --git a/docs/api/packages/random.md b/docs/api/packages/random.md
index 115744e..75916b4 100644
--- a/docs/api/packages/random.md
+++ b/docs/api/packages/random.md
@@ -526,7 +526,7 @@ func main() {
```
### RandNumberOfLength
-生成指定长度的随机数
+生成指定长度的随机数。
函数签名:
diff --git a/docs/en/guide/getting_started.md b/docs/en/guide/getting_started.md
index 6c1aa8b..3e75d7e 100644
--- a/docs/en/guide/getting_started.md
+++ b/docs/en/guide/getting_started.md
@@ -10,7 +10,7 @@ outline: deep
go get github.com/duke-git/lancet/v2 // will install latest version of v2.x.x
```
-2. For users who use version below go1.18, you should install v1.x.x. The latest of v1.x.x is v1.4.4.
+2. For users who use version below go1.18, you should install v1.x.x. The latest of v1.x.x is v1.4.5.
```go
go get github.com/duke-git/lancet // below go1.18, install latest version of v1.x.x
diff --git a/docs/guide/getting_started.md b/docs/guide/getting_started.md
index 7d13cb4..18ee61f 100644
--- a/docs/guide/getting_started.md
+++ b/docs/guide/getting_started.md
@@ -10,7 +10,7 @@ outline: deep
go get github.com/duke-git/lancet/v2 // will install latest version of v2.x.x
```
-2. 使用 go1.18 以下版本的用户,必须安装 v1.x.x。目前最新的 v1 版本是 v1.4.4。
+2. 使用 go1.18 以下版本的用户,必须安装 v1.x.x。目前最新的 v1 版本是 v1.4.5。
```go
go get github.com/duke-git/lancet // below go1.18, install latest version of v1.x.x