From 3f8e306ced999e83737269eb9ea578b3eecf97f8 Mon Sep 17 00:00:00 2001 From: dudaodong Date: Thu, 8 Aug 2024 15:44:19 +0800 Subject: [PATCH] doc: update deprecated warning text --- docs/api/packages/datastructure/set.md | 9 ++++---- docs/api/packages/netutil.md | 20 ++++++++++++---- docs/api/packages/slice.md | 28 +++++++++++++++++------ docs/en/api/packages/datastructure/set.md | 9 ++++---- docs/en/api/packages/netutil.md | 20 ++++++++++++---- docs/en/api/packages/slice.md | 28 +++++++++++++++++------ 6 files changed, 82 insertions(+), 32 deletions(-) diff --git a/docs/api/packages/datastructure/set.md b/docs/api/packages/datastructure/set.md index cd526b0..93dcbf5 100644 --- a/docs/api/packages/datastructure/set.md +++ b/docs/api/packages/datastructure/set.md @@ -24,7 +24,7 @@ import ( - [New](#New) - [FromSlice](#FromSlice) -- [Values](#Values) +- [Valuesdeprecated](#Values) - [Add](#Add) - [AddIfNotExist](#AddIfNotExist) - [AddIfNotExistBy](#AddIfNotExistBy) @@ -101,10 +101,11 @@ func main() { } ``` -### Valuesdeprecated +### Values -

获取集合中所有元素的切片
-ToSlice() 方法提供与 Values 方法相同的功能

+

获取集合中所有元素的切片。

+ +> ⚠️ 本函数已弃用,使用`ToSlice`代替。 函数签名: diff --git a/docs/api/packages/netutil.md b/docs/api/packages/netutil.md index 321f504..7fa895e 100644 --- a/docs/api/packages/netutil.md +++ b/docs/api/packages/netutil.md @@ -624,7 +624,9 @@ func main() { ### HttpGet -

发送http get请求。(已废弃:使用SendRequest)

+

发送http get请求。

+ +> ⚠️ 本函数已弃用,使用`SendRequest`代替。 函数签名: @@ -666,7 +668,9 @@ func main() { ### HttpPost -

发送http post请求。(已废弃:使用SendRequest)

+

发送http post请求。

+ +> ⚠️ 本函数已弃用,使用`SendRequest`代替。 函数签名: @@ -713,7 +717,9 @@ func main() { ### HttpPut -

发送http put请求。(已废弃:使用SendRequest)

+

发送http put请求。

+ +> ⚠️ 本函数已弃用,使用`SendRequest`代替。 函数签名: @@ -763,7 +769,9 @@ func main() { ### HttpDelete -

发送http delete请求。(已废弃:使用SendRequest)

+

发送http delete请求。

+ +> ⚠️ 本函数已弃用,使用`SendRequest`代替。 函数签名: @@ -802,7 +810,9 @@ func main() { ### HttpPatch -

发送http patch请求。(已废弃:使用SendRequest)

+

发送http patch请求。

+ +> ⚠️ 本函数已弃用,使用`SendRequest`代替。 函数签名: diff --git a/docs/api/packages/slice.md b/docs/api/packages/slice.md index b0c614a..fcb59e6 100644 --- a/docs/api/packages/slice.md +++ b/docs/api/packages/slice.md @@ -897,10 +897,12 @@ func main() { } ``` -### Find (废弃:使用 FindBy) +### Find

遍历slice的元素,返回第一个通过predicate函数真值测试的元素

+> ⚠️ 本函数已弃用,使用`FindBy`代替。 + 函数签名: ```go @@ -969,10 +971,12 @@ func main() { } ``` -### FindLast(废弃:使用 FindLastBy) +### FindLast

遍历slice的元素,返回最后一个通过predicate函数真值测试的元素。

+> ⚠️ 本函数已弃用,使用`FindLastBy`代替。 + 函数签名: ```go @@ -1244,10 +1248,12 @@ func main() { } ``` -### IntSlice (已弃用: 使用 go1.18+泛型代替) +### IntSlice

将接口切片转换为int切片

+> ⚠️ 本函数已弃用,使用go1.18+泛型代替。 + 函数签名: ```go @@ -1273,10 +1279,12 @@ func main() { } ``` -### InterfaceSlice(已弃用: 使用 go1.18+泛型代替) +### InterfaceSlice

将值转换为接口切片

+> ⚠️ 本函数已弃用,使用go1.18+泛型代替。 + 函数签名: ```go @@ -1543,10 +1551,12 @@ func main() { } ``` -### Merge(废弃:使用Concat) +### Merge

合并多个切片(不会消除重复元素).

+> ⚠️ 本函数已弃用,使用`Concat`代替。 + 函数签名: ```go @@ -1606,7 +1616,9 @@ func main() { ### Reduce -

将切片中的元素依次运行iteratee函数,返回运行结果(废弃:建议使用ReduceBy)

+

将切片中的元素依次运行iteratee函数,返回运行结果。

+ +> ⚠️ 本函数已弃用,使用`ReduceBy`代替。 函数签名: @@ -2132,10 +2144,12 @@ func main() { } ``` -### StringSlice(已弃用: 使用 go1.18+泛型代替) +### StringSlice

将接口切片转换为字符串切片

+> ⚠️ 本函数已弃用,使用go1.18+泛型代替。 + 函数签名: ```go diff --git a/docs/en/api/packages/datastructure/set.md b/docs/en/api/packages/datastructure/set.md index 852e58b..e6115fa 100644 --- a/docs/en/api/packages/datastructure/set.md +++ b/docs/en/api/packages/datastructure/set.md @@ -24,7 +24,7 @@ import ( - [New](#New) - [FromSlice](#FromSlice) -- [Values](#Values) +- [Valuesdeprecated](#Values) - [Add](#Add) - [AddIfNotExist](#AddIfNotExist) - [AddIfNotExistBy](#AddIfNotExistBy) @@ -102,10 +102,11 @@ func main() { } ``` -### Valuesdeprecated +### Values -

Return slice of all set data.
- The ToSlice() function provides the same functionality as Values and returns a slice containing all values of the set.

+

Return slice of all set data.

+ +> ⚠️ This function is deprecated. use `ToSlice` instead. Signature: diff --git a/docs/en/api/packages/netutil.md b/docs/en/api/packages/netutil.md index 7271a2f..6f68af7 100644 --- a/docs/en/api/packages/netutil.md +++ b/docs/en/api/packages/netutil.md @@ -624,7 +624,9 @@ func main() { ### HttpGet -

Send http get request. (Deprecated: use SendRequest for replacement)

+

Send http get request.

+ +> ⚠️ This function is deprecated. use `SendRequest` instead. Signature: @@ -666,7 +668,9 @@ func main() { ### HttpPost -

Send http post request.(Deprecated: use SendRequest for replacement)

+

Send http post request.

+ +> ⚠️ This function is deprecated. use `SendRequest` instead. Signature: @@ -713,7 +717,9 @@ func main() { ### HttpPut -

Send http put request. (Deprecated: use SendRequest for replacement)

+

Send http put request.

+ +> ⚠️ This function is deprecated. use `SendRequest` instead. Signature: @@ -763,7 +769,9 @@ func main() { ### HttpDelete -

Send http delete request. (Deprecated: use SendRequest for replacement)

+

Send http delete request.

+ +> ⚠️ This function is deprecated. use `SendRequest` instead. Signature: @@ -802,7 +810,9 @@ func main() { ### HttpPatch -

Send http patch request. (Deprecated: use SendRequest for replacement)

+

Send http patch request.

+ +> ⚠️ This function is deprecated. use `SendRequest` instead. Signature: diff --git a/docs/en/api/packages/slice.md b/docs/en/api/packages/slice.md index c1dc649..5ad9820 100644 --- a/docs/en/api/packages/slice.md +++ b/docs/en/api/packages/slice.md @@ -895,10 +895,12 @@ func main() { } ``` -### Find(deprecated: use FindBy) +### Find

Iterates over elements of slice, returning the first one that passes a truth test on function.

+> ⚠️ This function is deprecated. use `FindBy` instead. + Signature: ```go @@ -967,10 +969,12 @@ func main() { } ``` -### FindLast(deprecated: use FindLastBy) +### FindLast

iterates over elements of slice from end to begin, returning the last one that passes a truth test on function.

+> ⚠️ This function is deprecated. use `FindLastBy` instead. + Signature: ```go @@ -1242,10 +1246,12 @@ func main() { } ``` -### IntSlice (Deprecated: use generic feature of go1.18+ for replacement) +### IntSlice

Convert interface slice to int slice.

+> ⚠️ This function is deprecated. Use generic feature of go1.18+ for replacement. + Signature: ```go @@ -1271,10 +1277,12 @@ func main() { } ``` -### InterfaceSlice (Deprecated: use generic feature of go1.18+ for replacement) +### InterfaceSlice

Convert value to interface slice.

+> ⚠️ This function is deprecated. Use generic feature of go1.18+ for replacement. + Signature: ```go @@ -1541,10 +1549,12 @@ func main() { } ``` -### Merge(deprecated: use Concat) +### Merge

Merge all given slices into one slice.

+> ⚠️ This function is deprecated. use `Concat` instead. + Signature: ```go @@ -1604,7 +1614,9 @@ func main() { ### Reduce -

Reduce slice.(Deprecated: use ReduceBy)

+

Reduce slice.

+ +> ⚠️ This function is deprecated. use `ReduceBy` instead. Signature: @@ -2130,10 +2142,12 @@ func main() { } ``` -### StringSlice (Deprecated: use generic feature of go1.18+ for replacement) +### StringSlice

Convert interface slice to string slice.

+> ⚠️ This function is deprecated. use generic feature of go1.18+ for replacement + Signature: ```go