From 21a952d2be483a691ef7f768d6db175c3dc00819 Mon Sep 17 00:00:00 2001 From: dudaodong Date: Wed, 30 Aug 2023 11:59:04 +0800 Subject: [PATCH] doc: update doc styles --- docs/api/packages/algorithm.md | 26 +++--- docs/api/packages/compare.md | 16 ++-- docs/api/packages/concurrency.md | 63 +++++++------ docs/api/packages/condition.md | 18 ++-- docs/api/packages/convertor.md | 44 +++++---- docs/api/packages/cryptor.md | 84 ++++++++--------- docs/api/packages/datetime.md | 86 +++++++++-------- docs/api/packages/fileutil.md | 52 +++++------ docs/api/packages/formatter.md | 16 ++-- docs/api/packages/function.md | 20 ++-- docs/api/packages/maputil.md | 62 ++++++------ docs/api/packages/mathutil.md | 52 +++++------ docs/api/packages/netutil.md | 34 ++++--- docs/api/packages/pointer.md | 12 +-- docs/api/packages/random.md | 2 - docs/api/packages/retry.md | 11 +-- docs/api/packages/slice.md | 139 ++++++++++++++------------- docs/api/packages/stream.md | 54 ++++++----- docs/api/packages/strutil.md | 76 ++++++++------- docs/en/api/packages/algorithm.md | 26 +++--- docs/en/api/packages/compare.md | 16 ++-- docs/en/api/packages/concurrency.md | 22 ++--- docs/en/api/packages/condition.md | 18 ++-- docs/en/api/packages/convertor.md | 44 +++++---- docs/en/api/packages/cryptor.md | 84 ++++++++--------- docs/en/api/packages/datetime.md | 87 +++++++++-------- docs/en/api/packages/fileutil.md | 52 +++++------ docs/en/api/packages/formatter.md | 16 ++-- docs/en/api/packages/function.md | 19 ++-- docs/en/api/packages/maputil.md | 62 ++++++------ docs/en/api/packages/mathutil.md | 52 +++++------ docs/en/api/packages/netutil.md | 32 +++---- docs/en/api/packages/pointer.md | 12 +-- docs/en/api/packages/random.md | 20 ++-- docs/en/api/packages/retry.md | 12 +-- docs/en/api/packages/slice.md | 140 ++++++++++++++-------------- docs/en/api/packages/stream.md | 53 ++++++----- docs/en/api/packages/strutil.md | 76 ++++++++------- docs/en/api/packages/xerror.md | 26 +++--- docs/styles/api_doc.css | 4 - 40 files changed, 839 insertions(+), 901 deletions(-) delete mode 100644 docs/styles/api_doc.css diff --git a/docs/api/packages/algorithm.md b/docs/api/packages/algorithm.md index 47f33e5..f5d5f1b 100644 --- a/docs/api/packages/algorithm.md +++ b/docs/api/packages/algorithm.md @@ -39,8 +39,6 @@ import (
- - ## 文档 ### BubbleSort @@ -53,7 +51,7 @@ import ( func BubbleSort[T any](slice []T, comparator lancetconstraints.Comparator) ``` -示例:[运行](https://go.dev/play/p/GNdv7Jg2Taj) +示例:[运行](https://go.dev/play/p/GNdv7Jg2Taj) ```go package main @@ -101,7 +99,7 @@ func main() { func InsertionSort[T any](slice []T, comparator lancetconstraints.Comparator) ``` -示例:[运行](https://go.dev/play/p/G5LJiWgJJW6) +示例:[运行](https://go.dev/play/p/G5LJiWgJJW6) ```go package main @@ -164,7 +162,7 @@ func main() { func SelectionSort[T any](slice []T, comparator lancetconstraints.Comparator) ``` -示例:[运行](https://go.dev/play/p/oXovbkekayS) +示例:[运行](https://go.dev/play/p/oXovbkekayS) ```go package main @@ -212,7 +210,7 @@ func main() { func ShellSort[T any](slice []T, comparator lancetconstraints.Comparator) ``` -示例:[运行](https://go.dev/play/p/3ibkszpJEu3) +示例:[运行](https://go.dev/play/p/3ibkszpJEu3) ```go package main @@ -260,7 +258,7 @@ func main() { func QuickSort[T any](slice []T comparator lancetconstraints.Comparator) ``` -示例:[运行](https://go.dev/play/p/7Y7c1Elk3ax) +示例:[运行](https://go.dev/play/p/7Y7c1Elk3ax) ```go package main @@ -308,7 +306,7 @@ func main() { func HeapSort[T any](slice []T, comparator lancetconstraints.Comparator) ``` -示例:[运行](https://go.dev/play/p/u6Iwa1VZS_f) +示例:[运行](https://go.dev/play/p/u6Iwa1VZS_f) ```go package main @@ -356,7 +354,7 @@ func main() { func MergeSort[T any](slice []T, comparator lancetconstraints.Comparator) ``` -示例:[运行](https://go.dev/play/p/ydinn9YzUJn) +示例:[运行](https://go.dev/play/p/ydinn9YzUJn) ```go package main @@ -404,7 +402,7 @@ func main() { func CountSort[T any](slice []T, comparator lancetconstraints.Comparator) []T ``` -示例:[运行](https://go.dev/play/p/tB-Umgm0DrP) +示例:[运行](https://go.dev/play/p/tB-Umgm0DrP) ```go package main @@ -453,7 +451,7 @@ func main() { func BinarySearch[T any](sortedSlice []T, target T, lowIndex, highIndex int, comparator lancetconstraints.Comparator) int ``` -示例: [运行](https://go.dev/play/p/t6MeGiUSN47) +示例: [运行](https://go.dev/play/p/t6MeGiUSN47) ```go package main @@ -504,7 +502,7 @@ func main() { func BinaryIterativeSearch[T any](sortedSlice []T, target T, lowIndex, highIndex int, comparator lancetconstraints.Comparator) int ``` -示例: [运行](https://go.dev/play/p/Anozfr8ZLH3) +示例: [运行](https://go.dev/play/p/Anozfr8ZLH3) ```go package main @@ -555,7 +553,7 @@ func main() { func LinearSearch[T any](slice []T, target T, equal func(a, b T) bool) int ``` -示例: [运行](https://go.dev/play/p/IsS7rgn5s3x) +示例: [运行](https://go.dev/play/p/IsS7rgn5s3x) ```go package main @@ -598,7 +596,7 @@ func (l *LRUCache[K, V]) Delete(key K) bool func (l *LRUCache[K, V]) Len() int ``` -示例:[运行](https://go.dev/play/p/-EZjgOURufP) +示例:[运行](https://go.dev/play/p/-EZjgOURufP) ```go package main diff --git a/docs/api/packages/compare.md b/docs/api/packages/compare.md index 6425282..773506f 100644 --- a/docs/api/packages/compare.md +++ b/docs/api/packages/compare.md @@ -35,8 +35,6 @@ import (
- - ## 文档 ### Equal @@ -49,7 +47,7 @@ import ( func Equal(left, right any) bool ``` -示例: [运行](https://go.dev/play/p/wmVxR-to4lz) +示例: [运行](https://go.dev/play/p/wmVxR-to4lz) ```go package main @@ -98,7 +96,7 @@ func main() { func EqualValue(left, right any) bool ``` -示例: [运行](https://go.dev/play/p/fxnna_LLD9u) +示例: [运行](https://go.dev/play/p/fxnna_LLD9u) ```go package main @@ -137,7 +135,7 @@ func main() { func LessThan(left, right any) bool ``` -示例: [运行](https://go.dev/play/p/cYh7FQQj0ne) +示例: [运行](https://go.dev/play/p/cYh7FQQj0ne) ```go package main @@ -186,7 +184,7 @@ func main() { func GreaterThan(left, right any) bool ``` -示例: [运行](https://go.dev/play/p/9-NYDFZmIMp) +示例: [运行](https://go.dev/play/p/9-NYDFZmIMp) ```go package main @@ -238,7 +236,7 @@ func main() { func LessOrEqual(left, right any) bool ``` -示例: [运行](https://go.dev/play/p/e4T_scwoQzp) +示例: [运行](https://go.dev/play/p/e4T_scwoQzp) ```go package main @@ -287,7 +285,7 @@ func main() { func GreaterOrEqual(left, right any) bool ``` -示例: [运行](https://go.dev/play/p/vx8mP0U8DFk) +示例: [运行](https://go.dev/play/p/vx8mP0U8DFk) ```go package main @@ -339,7 +337,7 @@ func main() { func InDelta[T constraints.Integer | constraints.Float](left, right T, delta float64) bool ``` -示例: [运行](https://go.dev/play/p/TuDdcNtMkjo) +示例: [运行](https://go.dev/play/p/TuDdcNtMkjo) ```go package main diff --git a/docs/api/packages/concurrency.md b/docs/api/packages/concurrency.md index a16935a..d893b27 100644 --- a/docs/api/packages/concurrency.md +++ b/docs/api/packages/concurrency.md @@ -1,15 +1,17 @@ # Concurrency -并发包包含一些支持并发编程的功能。例如:goroutine, channel等。 + +并发包包含一些支持并发编程的功能。例如:goroutine, channel 等。
## 源码: -- [https://github.com/duke-git/lancet/blob/main/concurrency/channel.go](https://github.com/duke-git/lancet/blob/main/concurrency/channel.go) +- [https://github.com/duke-git/lancet/blob/main/concurrency/channel.go](https://github.com/duke-git/lancet/blob/main/concurrency/channel.go)
## 用法: + ```go import ( "github.com/duke-git/lancet/v2/concurrency" @@ -19,25 +21,24 @@ import (
## 目录 + ### Channel -- [NewChannel](#NewChannel) -- [Bridge](#Bridge) -- [FanIn](#FanIn) -- [Generate](#Generate) -- [Or](#Or) -- [OrDone](#OrDone) -- [Repeat](#Repeat) -- [RepeatFn](#RepeatFn) -- [Take](#Take) -- [Tee](#Tee) + +- [NewChannel](#NewChannel) +- [Bridge](#Bridge) +- [FanIn](#FanIn) +- [Generate](#Generate) +- [Or](#Or) +- [OrDone](#OrDone) +- [Repeat](#Repeat) +- [RepeatFn](#RepeatFn) +- [Take](#Take) +- [Tee](#Tee)
- - ## 文档 - ### Channel ### NewChannel @@ -50,7 +51,8 @@ import ( type Channel[T any] struct func NewChannel[T any]() *Channel[T] ``` -示例:[运行](https://go.dev/play/p/7aB4KyMMp9A) + +示例:[运行](https://go.dev/play/p/7aB4KyMMp9A) ```go package main @@ -74,7 +76,8 @@ func main() { ```go func (c *Channel[T]) Bridge(ctx context.Context, chanStream <-chan <-chan T) <-chan T ``` -示例:[运行](https://go.dev/play/p/qmWSy1NVF-Y) + +示例:[运行](https://go.dev/play/p/qmWSy1NVF-Y) ```go package main @@ -126,7 +129,8 @@ func main() { ```go func (c *Channel[T]) FanIn(ctx context.Context, channels ...<-chan T) <-chan T ``` -示例:[运行](https://go.dev/play/p/2VYFMexEvTm) + +示例:[运行](https://go.dev/play/p/2VYFMexEvTm) ```go package main @@ -165,7 +169,8 @@ func main() { ```go func (c *Channel[T]) Generate(ctx context.Context, values ...T) <-chan T ``` -示例:[运行](https://go.dev/play/p/7aB4KyMMp9A) + +示例:[运行](https://go.dev/play/p/7aB4KyMMp9A) ```go package main @@ -203,7 +208,8 @@ func main() { ```go func (c *Channel[T]) Repeat(ctx context.Context, values ...T) <-chan T ``` -示例:[运行](https://go.dev/play/p/k5N_ALVmYjE) + +示例:[运行](https://go.dev/play/p/k5N_ALVmYjE) ```go package main @@ -242,7 +248,8 @@ func main() { ```go func (c *Channel[T]) RepeatFn(ctx context.Context, fn func() T) <-chan T ``` -示例:[运行](https://go.dev/play/p/4J1zAWttP85) + +示例:[运行](https://go.dev/play/p/4J1zAWttP85) ```go package main @@ -283,7 +290,8 @@ func main() { ```go func (c *Channel[T]) Or(channels ...<-chan T) <-chan T ``` -示例:[运行](https://go.dev/play/p/Wqz9rwioPww) + +示例:[运行](https://go.dev/play/p/Wqz9rwioPww) ```go package main @@ -326,7 +334,8 @@ func main() { ```go func (c *Channel[T]) OrDone(ctx context.Context, channel <-chan T) <-chan T ``` -示例:[运行](https://go.dev/play/p/lm_GoS6aDjo) + +示例:[运行](https://go.dev/play/p/lm_GoS6aDjo) ```go package main @@ -364,7 +373,8 @@ func main() { ```go func (c *Channel[T]) Take(ctx context.Context, valueStream <-chan T, number int) <-chan T ``` -示例:[运行](https://go.dev/play/p/9Utt-1pDr2J) + +示例:[运行](https://go.dev/play/p/9Utt-1pDr2J) ```go package main @@ -410,7 +420,8 @@ func main() { ```go func (c *Channel[T]) Tee(ctx context.Context, in <-chan T) (<-chan T, <-chan T) ``` -示例:[运行](https://go.dev/play/p/3TQPKnCirrP) + +示例:[运行](https://go.dev/play/p/3TQPKnCirrP) ```go package main @@ -440,4 +451,4 @@ func main() { // 1 // 1 } -``` \ No newline at end of file +``` diff --git a/docs/api/packages/condition.md b/docs/api/packages/condition.md index b79015c..5a370ca 100644 --- a/docs/api/packages/condition.md +++ b/docs/api/packages/condition.md @@ -31,8 +31,6 @@ import (
- - ## 文档 ### Bool @@ -47,7 +45,7 @@ slices和map的length大于0时,返回true,否则返回false
```go func Bool[T any](value T) bool ``` -示例:[运行](https://go.dev/play/p/ETzeDJRSvhm) +示例:[运行](https://go.dev/play/p/ETzeDJRSvhm) ```go package main @@ -111,7 +109,7 @@ func main() { ```go func And[T, U any](a T, b U) bool ``` -示例:[运行](https://go.dev/play/p/W1SSUmt6pvr) +示例:[运行](https://go.dev/play/p/W1SSUmt6pvr) ```go package main @@ -137,7 +135,7 @@ func main() { ```go func Or[T, U any](a T, b U) bool ``` -示例:[运行](https://go.dev/play/p/UlQTxHaeEkq) +示例:[运行](https://go.dev/play/p/UlQTxHaeEkq) ```go package main @@ -163,7 +161,7 @@ func main() { ```go func Xor[T, U any](a T, b U) bool ``` -示例:[运行](https://go.dev/play/p/gObZrW7ZbG8) +示例:[运行](https://go.dev/play/p/gObZrW7ZbG8) ```go package main @@ -189,7 +187,7 @@ func main() { ```go func Nor[T, U any](a T, b U) bool ``` -示例:[运行](https://go.dev/play/p/g2j08F_zZky) +示例:[运行](https://go.dev/play/p/g2j08F_zZky) ```go package main @@ -215,7 +213,7 @@ func main() { ```go func Xnor[T, U any](a T, b U) bool ``` -示例:[运行](https://go.dev/play/p/OuDB9g51643) +示例:[运行](https://go.dev/play/p/OuDB9g51643) ```go package main @@ -241,7 +239,7 @@ func main() { ```go func Nand[T, U any](a T, b U) bool ``` -示例:[运行](https://go.dev/play/p/vSRMLxLIbq8) +示例:[运行](https://go.dev/play/p/vSRMLxLIbq8) ```go package main @@ -267,7 +265,7 @@ func main() { ```go func TernaryOperator[T, U any](isTrue T, ifValue U, elseValue U) U ``` -示例:[运行](https://go.dev/play/p/ElllPZY0guT) +示例:[运行](https://go.dev/play/p/ElllPZY0guT) ```go package main diff --git a/docs/api/packages/convertor.md b/docs/api/packages/convertor.md index a27423b..6a3e84d 100644 --- a/docs/api/packages/convertor.md +++ b/docs/api/packages/convertor.md @@ -46,8 +46,6 @@ import (
- - ## 文档 ### ColorHexToRGB @@ -60,7 +58,7 @@ import ( func ColorHexToRGB(colorHex string) (red, green, blue int) ``` -示例:[运行](https://go.dev/play/p/o7_ft-JCJBV) +示例:[运行](https://go.dev/play/p/o7_ft-JCJBV) ```go package main @@ -91,7 +89,7 @@ func main() { func ColorRGBToHex(red, green, blue int) string ``` -示例:[运行](https://go.dev/play/p/nzKS2Ro87J1) +示例:[运行](https://go.dev/play/p/nzKS2Ro87J1) ```go package main @@ -124,7 +122,7 @@ func main() { func ToBool(s string) (bool, error) ``` -示例:[运行](https://go.dev/play/p/ARht2WnGdIN) +示例:[运行](https://go.dev/play/p/ARht2WnGdIN) ```go package main @@ -165,7 +163,7 @@ func main() { func ToBytes(data any) ([]byte, error) ``` -示例:[运行](https://go.dev/play/p/fAMXYFDvOvr) +示例:[运行](https://go.dev/play/p/fAMXYFDvOvr) ```go package main @@ -198,7 +196,7 @@ func main() { func ToChar(s string) []string ``` -示例:[运行](https://go.dev/play/p/JJ1SvbFkVdM) +示例:[运行](https://go.dev/play/p/JJ1SvbFkVdM) ```go package main @@ -234,7 +232,7 @@ func main() { func ToChannel[T any](array []T) <-chan T ``` -示例:[运行](https://go.dev/play/p/hOx_oYZbAnL) +示例:[运行](https://go.dev/play/p/hOx_oYZbAnL) ```go package main @@ -271,7 +269,7 @@ func main() { func ToFloat(value any) (float64, error) ``` -示例:[运行](https://go.dev/play/p/4YTmPCibqHJ) +示例:[运行](https://go.dev/play/p/4YTmPCibqHJ) ```go package main @@ -316,7 +314,7 @@ func main() { func ToInt(value any) (int64, error) ``` -示例:[运行](https://go.dev/play/p/9_h9vIt-QZ_b) +示例:[运行](https://go.dev/play/p/9_h9vIt-QZ_b) ```go package main @@ -358,7 +356,7 @@ func main() { func ToJson(value any) (string, error) ``` -示例:[运行](https://go.dev/play/p/2rLIkMmXWvR) +示例:[运行](https://go.dev/play/p/2rLIkMmXWvR) ```go package main @@ -393,7 +391,7 @@ func main() { func ToMap[T any, K comparable, V any](array []T, iteratee func(T) (K, V)) map[K]V ``` -示例:[运行](https://go.dev/play/p/tVFy7E-t24l) +示例:[运行](https://go.dev/play/p/tVFy7E-t24l) ```go package main @@ -434,7 +432,7 @@ func main() { func ToPointer[T any](value T) *T ``` -示例:[运行](https://go.dev/play/p/ASf_etHNlw1) +示例:[运行](https://go.dev/play/p/ASf_etHNlw1) ```go package main @@ -463,7 +461,7 @@ func main() { func ToString(value any) string ``` -示例:[运行](https://go.dev/play/p/nF1zOOslpQq) +示例:[运行](https://go.dev/play/p/nF1zOOslpQq) ```go package main @@ -511,7 +509,7 @@ func main() { func StructToMap(value any) (map[string]any, error) ``` -示例:[运行](https://go.dev/play/p/KYGYJqNUBOI) +示例:[运行](https://go.dev/play/p/KYGYJqNUBOI) ```go package main @@ -549,7 +547,7 @@ func main() { func MapToSlice[T any, K comparable, V any](aMap map[K]V, iteratee func(K, V) T) []T ``` -示例:[运行](https://go.dev/play/p/dmX4Ix5V6Wl) +示例:[运行](https://go.dev/play/p/dmX4Ix5V6Wl) ```go package main @@ -579,7 +577,7 @@ func main() { func EncodeByte(data any) ([]byte, error) ``` -示例:[运行](https://go.dev/play/p/DVmM1G5JfuP) +示例:[运行](https://go.dev/play/p/DVmM1G5JfuP) ```go package main @@ -608,7 +606,7 @@ func main() { func DecodeByte(data []byte, target any) error ``` -示例:[运行](https://go.dev/play/p/zI6xsmuQRbn) +示例:[运行](https://go.dev/play/p/zI6xsmuQRbn) ```go package main @@ -644,7 +642,7 @@ func main() { func DeepClone[T any](src T) T ``` -示例:[运行](https://go.dev/play/p/j4DP5dquxnk) +示例:[运行](https://go.dev/play/p/j4DP5dquxnk) ```go package main @@ -708,7 +706,7 @@ func main() { func CopyProperties[T, U any](dst T, src U) (err error) ``` -示例:[运行](https://go.dev/play/p/oZujoB5Sgg5) +示例:[运行](https://go.dev/play/p/oZujoB5Sgg5) ```go package main @@ -787,7 +785,7 @@ func main() { func ToInterface(v reflect.Value) (value interface{}, ok bool) ``` -示例:[运行](https://go.dev/play/p/syqw0-WG7Xd) +示例:[运行](https://go.dev/play/p/syqw0-WG7Xd) ```go package main @@ -822,7 +820,7 @@ func main() { func Utf8ToGbk(bs []byte) ([]byte, error) ``` -示例:[运行](https://go.dev/play/p/9FlIaFLArIL) +示例:[运行](https://go.dev/play/p/9FlIaFLArIL) ```go package main @@ -856,7 +854,7 @@ func main() { func GbkToUtf8(bs []byte) ([]byte, error) ``` -示例:[运行](https://go.dev/play/p/OphmHCN_9u8) +示例:[运行](https://go.dev/play/p/OphmHCN_9u8) ```go package main diff --git a/docs/api/packages/cryptor.md b/docs/api/packages/cryptor.md index ba9aa55..617c839 100644 --- a/docs/api/packages/cryptor.md +++ b/docs/api/packages/cryptor.md @@ -68,8 +68,6 @@ import (
- - ## 文档 ### AesEcbEncrypt @@ -82,7 +80,7 @@ import ( func AesEcbEncrypt(data, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/zI6xsmuQRbn) +示例:[运行](https://go.dev/play/p/zI6xsmuQRbn) ```go package main @@ -116,7 +114,7 @@ func main() { func AesEcbDecrypt(encrypted, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/zI6xsmuQRbn) +示例:[运行](https://go.dev/play/p/zI6xsmuQRbn) ```go package main @@ -150,7 +148,7 @@ func main() { func AesCbcEncrypt(data, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/IOq_g8_lKZD) +示例:[运行](https://go.dev/play/p/IOq_g8_lKZD) ```go package main @@ -184,7 +182,7 @@ func main() { func AesCbcDecrypt(encrypted, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/IOq_g8_lKZD) +示例:[运行](https://go.dev/play/p/IOq_g8_lKZD) ```go package main @@ -218,7 +216,7 @@ func main() { func AesCtrCrypt(data, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/SpaZO0-5Nsp) +示例:[运行](https://go.dev/play/p/SpaZO0-5Nsp) ```go package main @@ -252,7 +250,7 @@ func main() { func AesCfbEncrypt(data, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/tfkF10B13kH) +示例:[运行](https://go.dev/play/p/tfkF10B13kH) ```go package main @@ -286,7 +284,7 @@ func main() { func AesCfbDecrypt(encrypted, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/tfkF10B13kH) +示例:[运行](https://go.dev/play/p/tfkF10B13kH) ```go package main @@ -320,7 +318,7 @@ func main() { func AesOfbEncrypt(data, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/VtHxtkUj-3F) +示例:[运行](https://go.dev/play/p/VtHxtkUj-3F) ```go package main @@ -354,7 +352,7 @@ func main() { func AesOfbDecrypt(encrypted, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/VtHxtkUj-3F) +示例:[运行](https://go.dev/play/p/VtHxtkUj-3F) ```go package main @@ -388,7 +386,7 @@ func main() { func Base64StdEncode(s string) string ``` -示例:[运行](https://go.dev/play/p/VOaUyQUreoK) +示例:[运行](https://go.dev/play/p/VOaUyQUreoK) ```go package main @@ -417,7 +415,7 @@ func main() { func Base64StdDecode(s string) string ``` -示例:[运行](https://go.dev/play/p/RWQylnJVgIe) +示例:[运行](https://go.dev/play/p/RWQylnJVgIe) ```go package main @@ -446,7 +444,7 @@ func main() { func DesEcbEncrypt(data, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/8qivmPeZy4P) +示例:[运行](https://go.dev/play/p/8qivmPeZy4P) ```go package main @@ -481,7 +479,7 @@ func main() { func DesEcbDecrypt(encrypted, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/8qivmPeZy4P) +示例:[运行](https://go.dev/play/p/8qivmPeZy4P) ```go package main @@ -516,7 +514,7 @@ func main() { func DesCbcEncrypt(data, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/4cC4QvWfe3_1) +示例:[运行](https://go.dev/play/p/4cC4QvWfe3_1) ```go package main @@ -550,7 +548,7 @@ func main() { func DesCbcDecrypt(encrypted, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/4cC4QvWfe3_1) +示例:[运行](https://go.dev/play/p/4cC4QvWfe3_1) ```go package main @@ -584,7 +582,7 @@ func main() { func DesCtrCrypt(data, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/9-T6OjKpcdw) +示例:[运行](https://go.dev/play/p/9-T6OjKpcdw) ```go package main @@ -618,7 +616,7 @@ func main() { func DesCfbEncrypt(data, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/y-eNxcFBlxL) +示例:[运行](https://go.dev/play/p/y-eNxcFBlxL) ```go package main @@ -652,7 +650,7 @@ func main() { func DesCfbDecrypt(encrypted, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/y-eNxcFBlxL) +示例:[运行](https://go.dev/play/p/y-eNxcFBlxL) ```go package main @@ -686,7 +684,7 @@ func main() { func DesOfbEncrypt(data, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/74KmNadjN1J) +示例:[运行](https://go.dev/play/p/74KmNadjN1J) ```go package main @@ -720,7 +718,7 @@ func main() { func DesOfbDecrypt(encrypted, key []byte) []byte ``` -示例:[运行](https://go.dev/play/p/74KmNadjN1J) +示例:[运行](https://go.dev/play/p/74KmNadjN1J) ```go package main @@ -754,7 +752,7 @@ func main() { func HmacMd5(str, key string) string ``` -示例:[运行](https://go.dev/play/p/uef0q1fz53I) +示例:[运行](https://go.dev/play/p/uef0q1fz53I) ```go package main @@ -786,7 +784,7 @@ func main() { func HmacMd5WithBase64(str, key string) string ``` -示例:[运行](https://go.dev/play/p/UY0ng2AefFC) +示例:[运行](https://go.dev/play/p/UY0ng2AefFC) ```go package main @@ -818,7 +816,7 @@ func main() { func HmacSha1(str, key string) string ``` -示例:[运行](https://go.dev/play/p/1UI4oQ4WXKM) +示例:[运行](https://go.dev/play/p/1UI4oQ4WXKM) ```go package main @@ -850,7 +848,7 @@ func main() { func HmacSha1WithBase64(str, key string) string ``` -示例:[运行](https://go.dev/play/p/47JmmGrnF7B) +示例:[运行](https://go.dev/play/p/47JmmGrnF7B) ```go package main @@ -882,7 +880,7 @@ func main() { func HmacSha256(str, key string) string ``` -示例:[运行](https://go.dev/play/p/HhpwXxFhhC0) +示例:[运行](https://go.dev/play/p/HhpwXxFhhC0) ```go package main @@ -914,7 +912,7 @@ func main() { func HmacSha256WithBase64(str, key string) string ``` -示例:[运行](https://go.dev/play/p/EKbkUvPTLwO) +示例:[运行](https://go.dev/play/p/EKbkUvPTLwO) ```go package main @@ -946,7 +944,7 @@ func main() { func HmacSha512(str, key string) string ``` -示例:[运行](https://go.dev/play/p/59Od6m4A0Ud) +示例:[运行](https://go.dev/play/p/59Od6m4A0Ud) ```go package main @@ -978,7 +976,7 @@ func main() { func HmacSha512WithBase64(str, key string) string ``` -示例:[运行](https://go.dev/play/p/c6dSe3E2ydU) +示例:[运行](https://go.dev/play/p/c6dSe3E2ydU) ```go package main @@ -1010,7 +1008,7 @@ func main() { func Md5String(str string) string ``` -示例:[运行](https://go.dev/play/p/1bLcVetbTOI) +示例:[运行](https://go.dev/play/p/1bLcVetbTOI) ```go package main @@ -1041,7 +1039,7 @@ func main() { func Md5StringWithBase64(s string) string ``` -示例:[运行](https://go.dev/play/p/Tcb-Z7LN2ax) +示例:[运行](https://go.dev/play/p/Tcb-Z7LN2ax) ```go package main @@ -1070,7 +1068,7 @@ func main() { func Md5Byte(data []byte) string ``` -示例:[运行](https://go.dev/play/p/suraalH8lyC) +示例:[运行](https://go.dev/play/p/suraalH8lyC) ```go package main @@ -1099,7 +1097,7 @@ func main() { func Md5ByteWithBase64(data []byte) string ``` -示例:[运行](https://go.dev/play/p/Lx4gH7Vdr5_y) +示例:[运行](https://go.dev/play/p/Lx4gH7Vdr5_y) ```go package main @@ -1154,7 +1152,7 @@ func main() { func Sha1(str string) string ``` -示例:[运行](https://go.dev/play/p/_m_uoD1deMT) +示例:[运行](https://go.dev/play/p/_m_uoD1deMT) ```go package main @@ -1185,7 +1183,7 @@ func main() { func Sha1WithBase64(str string) string ``` -示例:[运行](https://go.dev/play/p/fSyx-Gl2l2-) +示例:[运行](https://go.dev/play/p/fSyx-Gl2l2-) ```go package main @@ -1214,7 +1212,7 @@ func main() { func Sha256(str string) string ``` -示例:[运行](https://go.dev/play/p/tU9tfBMIAr1) +示例:[运行](https://go.dev/play/p/tU9tfBMIAr1) ```go package main @@ -1245,7 +1243,7 @@ func main() { func Sha256WithBase64(str string) string ``` -示例:[运行](https://go.dev/play/p/85IXJHIal1k) +示例:[运行](https://go.dev/play/p/85IXJHIal1k) ```go package main @@ -1274,7 +1272,7 @@ func main() { func Sha512(str string) string ``` -示例:[运行](https://go.dev/play/p/3WsvLYZxsHa) +示例:[运行](https://go.dev/play/p/3WsvLYZxsHa) ```go package main @@ -1305,7 +1303,7 @@ func main() { func Sha512WithBase64(str string) string ``` -示例:[运行](https://go.dev/play/p/q_fY2rA-k5I) +示例:[运行](https://go.dev/play/p/q_fY2rA-k5I) ```go package main @@ -1334,7 +1332,7 @@ func main() { func GenerateRsaKey(keySize int, priKeyFile, pubKeyFile string) error ``` -示例:[运行](https://go.dev/play/p/zutRHrDqs0X) +示例:[运行](https://go.dev/play/p/zutRHrDqs0X) ```go package main @@ -1362,7 +1360,7 @@ func main() { func RsaEncrypt(data []byte, pubKeyFileName string) []byte ``` -示例:[运行](https://go.dev/play/p/uef0q1fz53I) +示例:[运行](https://go.dev/play/p/uef0q1fz53I) ```go package main @@ -1399,7 +1397,7 @@ func main() { func RsaDecrypt(data []byte, privateKeyFileName string) []byte ``` -示例:[运行](https://go.dev/play/p/uef0q1fz53I) +示例:[运行](https://go.dev/play/p/uef0q1fz53I) ```go package main diff --git a/docs/api/packages/datetime.md b/docs/api/packages/datetime.md index 51c9392..8b10524 100644 --- a/docs/api/packages/datetime.md +++ b/docs/api/packages/datetime.md @@ -67,8 +67,6 @@ import (
- - ## 文档 ## 注: @@ -108,7 +106,7 @@ import ( func AddDay(t time.Time, day int64) time.Time ``` -示例:[运行](https://go.dev/play/p/dIGbs_uTdFa) +示例:[运行](https://go.dev/play/p/dIGbs_uTdFa) ```go package main @@ -147,7 +145,7 @@ func main() { func AddHour(t time.Time, hour int64) time.Time ``` -示例:[运行](https://go.dev/play/p/rcMjd7OCsi5) +示例:[运行](https://go.dev/play/p/rcMjd7OCsi5) ```go package main @@ -186,7 +184,7 @@ func main() { func AddMinute(t time.Time, minute int64) time.Time ``` -示例:[运行](https://go.dev/play/p/nT1heB1KUUK) +示例:[运行](https://go.dev/play/p/nT1heB1KUUK) ```go package main @@ -225,7 +223,7 @@ func main() { func AddYear(t time.Time, year int64) time.Time ``` -示例:[运行](https://go.dev/play/p/MqW2ujnBx10) +示例:[运行](https://go.dev/play/p/MqW2ujnBx10) ```go package main @@ -264,7 +262,7 @@ func main() { func BeginOfMinute(t time.Time) time.Time ``` -示例:[运行](https://go.dev/play/p/ieOLVJ9CiFT) +示例:[运行](https://go.dev/play/p/ieOLVJ9CiFT) ```go package main @@ -296,7 +294,7 @@ func main() { func BeginOfHour(t time.Time) time.Time ``` -示例:[运行](https://go.dev/play/p/GhdGFnDWpYs) +示例:[运行](https://go.dev/play/p/GhdGFnDWpYs) ```go package main @@ -328,7 +326,7 @@ func main() { func BeginOfDay(t time.Time) time.Time ``` -示例:[运行](https://go.dev/play/p/94m_UT6cWs9) +示例:[运行](https://go.dev/play/p/94m_UT6cWs9) ```go package main @@ -360,7 +358,7 @@ func main() { func BeginOfWeek(t time.Time, beginFrom ...time.Weekday) time.Time ``` -示例:[运行](https://go.dev/play/p/ynjoJPz7VNV) +示例:[运行](https://go.dev/play/p/ynjoJPz7VNV) ```go package main @@ -392,7 +390,7 @@ func main() { func BeginOfMonth(t time.Time) time.Time ``` -示例:[运行](https://go.dev/play/p/bWXVFsmmzwL) +示例:[运行](https://go.dev/play/p/bWXVFsmmzwL) ```go package main @@ -424,7 +422,7 @@ func main() { func BeginOfYear(t time.Time) time.Time ``` -示例:[运行](https://go.dev/play/p/i326DSwLnV8) +示例:[运行](https://go.dev/play/p/i326DSwLnV8) ```go package main @@ -456,7 +454,7 @@ func main() { func EndOfMinute(t time.Time) time.Time ``` -示例:[运行](https://go.dev/play/p/yrL5wGzPj4z) +示例:[运行](https://go.dev/play/p/yrL5wGzPj4z) ```go package main @@ -488,7 +486,7 @@ func main() { func EndOfHour(t time.Time) time.Time ``` -示例:[运行](https://go.dev/play/p/6ce3j_6cVqN) +示例:[运行](https://go.dev/play/p/6ce3j_6cVqN) ```go package main @@ -520,7 +518,7 @@ func main() { func EndOfDay(t time.Time) time.Time ``` -示例:[运行](https://go.dev/play/p/eMBOvmq5Ih1) +示例:[运行](https://go.dev/play/p/eMBOvmq5Ih1) ```go package main @@ -552,7 +550,7 @@ func main() { func EndOfWeek(t time.Time, endWith ...time.Weekday) time.Time ``` -示例:[运行](https://go.dev/play/p/i08qKXD9flf) +示例:[运行](https://go.dev/play/p/i08qKXD9flf) ```go package main @@ -584,7 +582,7 @@ func main() { func EndOfMonth(t time.Time) time.Time ``` -示例:[运行](https://go.dev/play/p/_GWh10B3Nqi) +示例:[运行](https://go.dev/play/p/_GWh10B3Nqi) ```go package main @@ -616,7 +614,7 @@ func main() { func EndOfYear(t time.Time) time.Time ``` -示例:[运行](https://go.dev/play/p/G01cKlMCvNm) +示例:[运行](https://go.dev/play/p/G01cKlMCvNm) ```go package main @@ -648,7 +646,7 @@ func main() { func GetNowDate() string ``` -示例:[运行](https://go.dev/play/p/PvfkPpcpBBf) +示例:[运行](https://go.dev/play/p/PvfkPpcpBBf) ```go package main @@ -677,7 +675,7 @@ func main() { func GetNowTime() string ``` -示例:[运行](https://go.dev/play/p/l7BNxCkTmJS) +示例:[运行](https://go.dev/play/p/l7BNxCkTmJS) ```go package main @@ -706,7 +704,7 @@ func main() { func GetNowDateTime() string ``` -示例:[运行](https://go.dev/play/p/pI4AqngD0al) +示例:[运行](https://go.dev/play/p/pI4AqngD0al) ```go package main @@ -735,7 +733,7 @@ func main() { func GetTodayStartTime() string ``` -示例:[运行](https://go.dev/play/p/84siyYF7t99) +示例:[运行](https://go.dev/play/p/84siyYF7t99) ```go package main @@ -764,7 +762,7 @@ func main() { func GetTodayEndTime() string ``` -示例:[运行](https://go.dev/play/p/jjrLnfoqgn3) +示例:[运行](https://go.dev/play/p/jjrLnfoqgn3) ```go package main @@ -793,7 +791,7 @@ func main() { func GetZeroHourTimestamp() int64 ``` -示例:[运行](https://go.dev/play/p/QmL2oIaGE3q) +示例:[运行](https://go.dev/play/p/QmL2oIaGE3q) ```go package main @@ -822,7 +820,7 @@ func main() { func GetNightTimestamp() int64 ``` -示例:[运行](https://go.dev/play/p/UolysR3MYP1) +示例:[运行](https://go.dev/play/p/UolysR3MYP1) ```go package main @@ -851,7 +849,7 @@ func main() { func FormatTimeToStr(t time.Time, format string, timezone ...string) string ``` -示例:[运行](https://go.dev/play/p/_Ia7M8H_OvE) +示例:[运行](https://go.dev/play/p/_Ia7M8H_OvE) ```go package main @@ -890,7 +888,7 @@ func main() { func FormatStrToTime(str, format string, timezone ...string) (time.Time, error) ``` -示例:[运行](https://go.dev/play/p/1h9FwdU8ql4) +示例:[运行](https://go.dev/play/p/1h9FwdU8ql4) ```go package main @@ -929,7 +927,7 @@ type theTime struct { func NewUnixNow() *theTime ``` -示例:[运行](https://go.dev/play/p/U4PPx-9D0oz) +示例:[运行](https://go.dev/play/p/U4PPx-9D0oz) ```go package main @@ -961,7 +959,7 @@ type theTime struct { func NewUnix(unix int64) *theTime ``` -示例:[运行](https://go.dev/play/p/psoSuh_kLRt) +示例:[运行](https://go.dev/play/p/psoSuh_kLRt) ```go package main @@ -993,7 +991,7 @@ type theTime struct { func NewFormat(t string) (*theTime, error) ``` -示例:[运行](https://go.dev/play/p/VkW08ZOaXPZ) +示例:[运行](https://go.dev/play/p/VkW08ZOaXPZ) ```go package main @@ -1025,7 +1023,7 @@ type theTime struct { func NewISO8601(iso8601 string) (*theTime, error) ``` -示例:[运行](https://go.dev/play/p/mkhOHQkdeA2) +示例:[运行](https://go.dev/play/p/mkhOHQkdeA2) ```go package main @@ -1054,7 +1052,7 @@ func main() { func (t *theTime) ToUnix() int64 ``` -示例:[运行](https://go.dev/play/p/_LUiwAdocjy) +示例:[运行](https://go.dev/play/p/_LUiwAdocjy) ```go package main @@ -1083,7 +1081,7 @@ func main() { func (t *theTime) ToFormat() string ``` -示例:[运行](https://go.dev/play/p/VkW08ZOaXPZ) +示例:[运行](https://go.dev/play/p/VkW08ZOaXPZ) ```go package main @@ -1112,7 +1110,7 @@ func main() { func (t *theTime) ToFormatForTpl(tpl string) string ``` -示例:[运行](https://go.dev/play/p/nyXxXcQJ8L5) +示例:[运行](https://go.dev/play/p/nyXxXcQJ8L5) ```go package main @@ -1142,7 +1140,7 @@ func main() { func (t *theTime) ToIso8601() string ``` -示例:[运行](https://go.dev/play/p/mkhOHQkdeA2) +示例:[运行](https://go.dev/play/p/mkhOHQkdeA2) ```go package main @@ -1172,7 +1170,7 @@ func main() { func IsLeapYear(year int) bool ``` -示例:[运行](https://go.dev/play/p/xS1eS2ejGew) +示例:[运行](https://go.dev/play/p/xS1eS2ejGew) ```go package main @@ -1205,7 +1203,7 @@ func main() { func BetweenSeconds(t1 time.Time, t2 time.Time) int64 ``` -示例:[运行](https://go.dev/play/p/n3YDRyfyXJu) +示例:[运行](https://go.dev/play/p/n3YDRyfyXJu) ```go package main @@ -1242,7 +1240,7 @@ func main() { func DayOfYear(t time.Time) int ``` -示例:[运行](https://go.dev/play/p/0hjqhTwFNlH) +示例:[运行](https://go.dev/play/p/0hjqhTwFNlH) ```go package main @@ -1283,7 +1281,7 @@ func main() { func IsWeekend(t time.Time) bool ``` -示例:[运行](https://go.dev/play/p/cupRM5aZOIY) +示例:[运行](https://go.dev/play/p/cupRM5aZOIY) ```go package main @@ -1323,7 +1321,7 @@ func main() { func NowDateOrTime(format string, timezone ...string) string ``` -示例:[运行](https://go.dev/play/p/EZ-begEjtT0) +示例:[运行](https://go.dev/play/p/EZ-begEjtT0) ```go package main @@ -1357,7 +1355,7 @@ func main() { func Timestamp(timezone ...string) int64 ``` -示例:[运行](https://go.dev/play/p/iU5b7Vvjx6x) +示例:[运行](https://go.dev/play/p/iU5b7Vvjx6x) ```go package main @@ -1388,7 +1386,7 @@ func main() { func TimestampMilli(timezone ...string) int64 ``` -示例:[运行](https://go.dev/play/p/4gvEusOTu1T) +示例:[运行](https://go.dev/play/p/4gvEusOTu1T) ```go package main @@ -1418,7 +1416,7 @@ func main() { func TimestampMicro(timezone ...string) int64 ``` -示例:[运行](https://go.dev/play/p/2maANglKHQE) +示例:[运行](https://go.dev/play/p/2maANglKHQE) ```go package main @@ -1448,7 +1446,7 @@ func main() { func TimestampNano(timezone ...string) int64 ``` -示例:[运行](https://go.dev/play/p/A9Oq_COrcCF) +示例:[运行](https://go.dev/play/p/A9Oq_COrcCF) ```go package main diff --git a/docs/api/packages/fileutil.md b/docs/api/packages/fileutil.md index 6e95162..bb6d2d1 100644 --- a/docs/api/packages/fileutil.md +++ b/docs/api/packages/fileutil.md @@ -50,8 +50,6 @@ import (
- - ## 文档 ### ClearFile @@ -64,7 +62,7 @@ import ( func ClearFile(path string) error ``` -示例:[运行](https://go.dev/play/p/NRZ0ZT-G94H) +示例:[运行](https://go.dev/play/p/NRZ0ZT-G94H) ```go package main @@ -92,7 +90,7 @@ func main() { func CreateFile(path string) bool ``` -示例:[运行](https://go.dev/play/p/lDt8PEsTNKI) +示例:[运行](https://go.dev/play/p/lDt8PEsTNKI) ```go package main @@ -118,7 +116,7 @@ func main() { func CreateDir(absPath string) error ``` -示例:[运行](https://go.dev/play/p/qUuCe1OGQnM) +示例:[运行](https://go.dev/play/p/qUuCe1OGQnM) ```go package main @@ -144,7 +142,7 @@ func main() { func CopyFile(srcPath string, dstPath string) error ``` -示例:[运行](https://go.dev/play/p/Jg9AMJMLrJi) +示例:[运行](https://go.dev/play/p/Jg9AMJMLrJi) ```go package main @@ -172,7 +170,7 @@ func main() { func CurrentPath() string ``` -示例:[运行](https://go.dev/play/p/s74a9iBGcSw) +示例:[运行](https://go.dev/play/p/s74a9iBGcSw) ```go package main @@ -198,7 +196,7 @@ func main() { func FileMode(path string) (fs.FileMode, error) ``` -示例:[运行](https://go.dev/play/p/2l2hI42fA3p) +示例:[运行](https://go.dev/play/p/2l2hI42fA3p) ```go package main @@ -227,7 +225,7 @@ func main() { func MiMeType(file any) string ``` -示例:[运行](https://go.dev/play/p/bd5sevSUZNu) +示例:[运行](https://go.dev/play/p/bd5sevSUZNu) ```go package main @@ -258,7 +256,7 @@ func main() { func IsExist(path string) bool ``` -示例:[运行](https://go.dev/play/p/nKKXt8ZQbmh) +示例:[运行](https://go.dev/play/p/nKKXt8ZQbmh) ```go package main @@ -285,7 +283,7 @@ func main() { func IsLink(path string) bool ``` -示例:[运行](https://go.dev/play/p/TL-b-Kzvf44) +示例:[运行](https://go.dev/play/p/TL-b-Kzvf44) ```go package main @@ -311,7 +309,7 @@ func main() { func IsDir(path string) bool ``` -示例:[运行](https://go.dev/play/p/WkVwEKqtOWk) +示例:[运行](https://go.dev/play/p/WkVwEKqtOWk) ```go package main @@ -340,7 +338,7 @@ func main() { func ListFileNames(path string) ([]string, error) ``` -示例:[运行](https://go.dev/play/p/Tjd7Y07rejl) +示例:[运行](https://go.dev/play/p/Tjd7Y07rejl) ```go package main @@ -366,7 +364,7 @@ func main() { func RemoveFile(path string) error ``` -示例:[运行](https://go.dev/play/p/P2y0XW8a1SH) +示例:[运行](https://go.dev/play/p/P2y0XW8a1SH) ```go package main @@ -394,7 +392,7 @@ func main() { func ReadFileToString(path string) (string, error) ``` -示例:[运行](https://go.dev/play/p/cmfwp_5SQTp) +示例:[运行](https://go.dev/play/p/cmfwp_5SQTp) ```go package main @@ -427,7 +425,7 @@ func main() { func ReadFileByLine(path string)([]string, error) ``` -示例:[运行](https://go.dev/play/p/svJP_7ZrBrD) +示例:[运行](https://go.dev/play/p/svJP_7ZrBrD) ```go package main @@ -461,7 +459,7 @@ func main() { func Zip(fpath string, destPath string) error ``` -示例:[运行](https://go.dev/play/p/j-3sWBp8ik_P) +示例:[运行](https://go.dev/play/p/j-3sWBp8ik_P) ```go package main @@ -489,7 +487,7 @@ func main() { func ZipAppendEntry(fpath string, destPath string) error ``` -示例:[运行](https://go.dev/play/p/cxvaT8TRNQp) +示例:[运行](https://go.dev/play/p/cxvaT8TRNQp) ```go package main @@ -517,7 +515,7 @@ func main() { func UnZip(zipFile string, destPath string) error ``` -示例:[运行](https://go.dev/play/p/g0w34kS7B8m) +示例:[运行](https://go.dev/play/p/g0w34kS7B8m) ```go package main @@ -545,7 +543,7 @@ func main() { func IsZipFile(filepath string) bool ``` -示例:[运行](https://go.dev/play/p/9M0g2j_uF_e) +示例:[运行](https://go.dev/play/p/9M0g2j_uF_e) ```go package main @@ -571,7 +569,7 @@ func main() { func FileSize(path string) (int64, error) ``` -示例:[运行](https://go.dev/play/p/H9Z05uD-Jjc) +示例:[运行](https://go.dev/play/p/H9Z05uD-Jjc) ```go package main @@ -603,7 +601,7 @@ func main() { func MTime(filepath string) (int64, error) ``` -示例:[运行](https://go.dev/play/p/s_Tl7lZoAaY) +示例:[运行](https://go.dev/play/p/s_Tl7lZoAaY) ```go package main @@ -635,7 +633,7 @@ func main() { func Sha(filepath string, shaType ...int) (string, error) ``` -示例:[运行](https://go.dev/play/p/VfEEcO2MJYf) +示例:[运行](https://go.dev/play/p/VfEEcO2MJYf) ```go package main @@ -673,7 +671,7 @@ func main() { func ReadCsvFile(filepath string) ([][]string, error) ``` -示例:[运行](https://go.dev/play/p/OExTkhGEd3_u) +示例:[运行](https://go.dev/play/p/OExTkhGEd3_u) ```go package main @@ -705,7 +703,7 @@ func main() { func WriteCsvFile(filepath string, records [][]string, append bool) error ``` -示例:[运行](https://go.dev/play/p/dAXm58Q5U1o) +示例:[运行](https://go.dev/play/p/dAXm58Q5U1o) ```go package main @@ -754,7 +752,7 @@ func main() { func WriteBytesToFile(filepath string, content []byte) error ``` -示例:[运行](https://go.dev/play/p/s7QlDxMj3P8) +示例:[运行](https://go.dev/play/p/s7QlDxMj3P8) ```go package main @@ -803,7 +801,7 @@ func main() { func WriteStringToFile(filepath string, content string, append bool) error ``` -示例:[运行](https://go.dev/play/p/GhLS6d8lH_g) +示例:[运行](https://go.dev/play/p/GhLS6d8lH_g) ```go package main diff --git a/docs/api/packages/formatter.md b/docs/api/packages/formatter.md index 202d645..016cf47 100644 --- a/docs/api/packages/formatter.md +++ b/docs/api/packages/formatter.md @@ -33,8 +33,6 @@ import (
- - ## 文档 ### Comma @@ -47,7 +45,7 @@ import ( func Comma[T constraints.Float | constraints.Integer | string](value T, symbol string) string ``` -示例:[运行](https://go.dev/play/p/eRD5k2vzUVX) +示例:[运行](https://go.dev/play/p/eRD5k2vzUVX) ```go package main @@ -83,7 +81,7 @@ func main() { func Pretty(v any) (string, error) ``` -示例:[运行](https://go.dev/play/p/YsciGj3FH2x) +示例:[运行](https://go.dev/play/p/YsciGj3FH2x) ```go package main @@ -122,7 +120,7 @@ func main() { func PrettyToWriter(v any, out io.Writer) error ``` -示例:[运行](https://go.dev/play/p/LPLZ3lDi5ma) +示例:[运行](https://go.dev/play/p/LPLZ3lDi5ma) ```go package main @@ -165,7 +163,7 @@ func main() { func DecimalBytes(size float64, precision ...int) string ``` -示例:[运行](https://go.dev/play/p/FPXs1suwRcs) +示例:[运行](https://go.dev/play/p/FPXs1suwRcs) ```go package main @@ -204,7 +202,7 @@ func main() { func BinaryBytes(size float64, precision ...int) string ``` -示例:[运行](https://go.dev/play/p/G9oHHMCAZxP) +示例:[运行](https://go.dev/play/p/G9oHHMCAZxP) ```go package main @@ -243,7 +241,7 @@ func main() { func ParseDecimalBytes(size string) (uint64, error) ``` -示例:[运行](https://go.dev/play/p/Am98ybWjvjj) +示例:[运行](https://go.dev/play/p/Am98ybWjvjj) ```go package main @@ -282,7 +280,7 @@ func main() { func ParseBinaryBytes(size string) (uint64, error) ``` -示例:[运行](https://go.dev/play/p/69v1tTT62x8) +示例:[运行](https://go.dev/play/p/69v1tTT62x8) ```go package main diff --git a/docs/api/packages/function.md b/docs/api/packages/function.md index 186bb79..cc330d5 100644 --- a/docs/api/packages/function.md +++ b/docs/api/packages/function.md @@ -37,8 +37,6 @@ import ( ## 文档 - - ### After

创建一个函数,当他被调用n或更多次之后将马上触发fn

@@ -49,7 +47,7 @@ import ( func After(n int, fn any) func(args ...any) []reflect.Value ``` -示例:[运行](https://go.dev/play/p/eRD5k2vzUVX) +示例:[运行](https://go.dev/play/p/eRD5k2vzUVX) ```go package main @@ -82,7 +80,7 @@ func main() { func Before(n int, fn any) func(args ...any) []reflect.Value ``` -示例:[运行](https://go.dev/play/p/0HqUDIFZ3IL) +示例:[运行](https://go.dev/play/p/0HqUDIFZ3IL) ```go package main @@ -119,7 +117,7 @@ type CurryFn[T any] func(...T) T func (cf CurryFn[T]) New(val T) func(...T) T ``` -示例:[运行](https://go.dev/play/p/5HopfDwANKX) +示例:[运行](https://go.dev/play/p/5HopfDwANKX) ```go package main @@ -158,7 +156,7 @@ func main() { func Compose[T any](fnList ...func(...T) T) func(...T) T ``` -示例:[运行](https://go.dev/play/p/KKfugD4PKYF) +示例:[运行](https://go.dev/play/p/KKfugD4PKYF) ```go package main @@ -196,7 +194,7 @@ func main() { func Debounced(fn func(), duration time.Duration) func() ``` -示例:[运行](https://go.dev/play/p/absuEGB_GN7) +示例:[运行](https://go.dev/play/p/absuEGB_GN7) ```go package main @@ -246,7 +244,7 @@ func main() { func Delay(delay time.Duration, fn any, args ...any) ``` -示例:[运行](https://go.dev/play/p/Ivtc2ZE-Tye) +示例:[运行](https://go.dev/play/p/Ivtc2ZE-Tye) ```go package main @@ -278,7 +276,7 @@ func main() { func Schedule(d time.Duration, fn any, args ...any) chan bool ``` -示例:[运行](https://go.dev/play/p/hbON-Xeyn5N) +示例:[运行](https://go.dev/play/p/hbON-Xeyn5N) ```go package main @@ -317,7 +315,7 @@ func main() { func Pipeline[T any](funcs ...func(T) T) func(T) T ``` -示例:[运行](https://go.dev/play/p/mPdUVvj6HD6) +示例:[运行](https://go.dev/play/p/mPdUVvj6HD6) ```go package main @@ -369,7 +367,7 @@ func (w *Watcher) GetElapsedTime() time.Duration ``` -示例:[运行](https://go.dev/play/p/l2yrOpCLd1I) +示例:[运行](https://go.dev/play/p/l2yrOpCLd1I) ```go package main diff --git a/docs/api/packages/maputil.md b/docs/api/packages/maputil.md index 3e95ee9..f6da5c3 100644 --- a/docs/api/packages/maputil.md +++ b/docs/api/packages/maputil.md @@ -55,8 +55,6 @@ import (
- - ## API 文档: ### MapTo @@ -69,7 +67,7 @@ import ( func MapTo(src any, dst any) error ``` -示例:[运行](https://go.dev/play/p/4K7KBEPgS5M) +示例:[运行](https://go.dev/play/p/4K7KBEPgS5M) ```go package main @@ -126,7 +124,7 @@ func main() { func ForEach[K comparable, V any](m map[K]V, iteratee func(key K, value V)) ``` -示例:[运行](https://go.dev/play/p/OaThj6iNVXK) +示例:[运行](https://go.dev/play/p/OaThj6iNVXK) ```go package main @@ -167,7 +165,7 @@ func main() { func Filter[K comparable, V any](m map[K]V, predicate func(key K, value V) bool) map[K]V ``` -示例:[运行](https://go.dev/play/p/fSvF3wxuNG7) +示例:[运行](https://go.dev/play/p/fSvF3wxuNG7) ```go package main @@ -212,7 +210,7 @@ func main() { func FilterByKeys[K comparable, V any](m map[K]V, keys []K) map[K]V ``` -示例:[运行](https://go.dev/play/p/7ov6BJHbVqh) +示例:[运行](https://go.dev/play/p/7ov6BJHbVqh) ```go package main @@ -250,7 +248,7 @@ func main() { func FilterByValues[K comparable, V comparable](m map[K]V, values []V) map[K]V ``` -示例:[运行](https://go.dev/play/p/P3-9MdcXegR) +示例:[运行](https://go.dev/play/p/P3-9MdcXegR) ```go package main @@ -288,7 +286,7 @@ func main() { func OmitBy[K comparable, V any](m map[K]V, predicate func(key K, value V) bool) map[K]V ``` -示例:[运行](https://go.dev/play/p/YJM4Hj5hNwm) +示例:[运行](https://go.dev/play/p/YJM4Hj5hNwm) ```go package main @@ -329,7 +327,7 @@ func main() { func OmitByKeys[K comparable, V any](m map[K]V, keys []K) map[K]V ``` -示例:[运行](https://go.dev/play/p/jXGrWDBfSRp) +示例:[运行](https://go.dev/play/p/jXGrWDBfSRp) ```go package main @@ -367,7 +365,7 @@ func main() { func OmitByValues[K comparable, V comparable](m map[K]V, values []V) map[K]V ``` -示例:[运行](https://go.dev/play/p/XB7Y10uw20_U) +示例:[运行](https://go.dev/play/p/XB7Y10uw20_U) ```go package main @@ -405,7 +403,7 @@ func main() { func Intersect[K comparable, V any](maps ...map[K]V) map[K]V ``` -示例:[运行](https://go.dev/play/p/Zld0oj3sjcC) +示例:[运行](https://go.dev/play/p/Zld0oj3sjcC) ```go package main @@ -460,7 +458,7 @@ func main() { func Keys[K comparable, V any](m map[K]V) []K ``` -示例:[运行](https://go.dev/play/p/xNB5bTb97Wd) +示例:[运行](https://go.dev/play/p/xNB5bTb97Wd) ```go package main @@ -499,7 +497,7 @@ func main() { func Merge[K comparable, V any](maps ...map[K]V) map[K]V ``` -示例:[运行](https://go.dev/play/p/H95LENF1uB-) +示例:[运行](https://go.dev/play/p/H95LENF1uB-) ```go package main @@ -538,7 +536,7 @@ func main() { func Minus[K comparable, V any](mapA, mapB map[K]V) map[K]V ``` -示例:[运行](https://go.dev/play/p/3u5U9K7YZ9m) +示例:[运行](https://go.dev/play/p/3u5U9K7YZ9m) ```go package main @@ -580,7 +578,7 @@ func main() { func Values[K comparable, V any](m map[K]V) []V ``` -示例:[运行](https://go.dev/play/p/CBKdUc5FTW6) +示例:[运行](https://go.dev/play/p/CBKdUc5FTW6) ```go package main @@ -617,7 +615,7 @@ func main() { func KeysBy[K comparable, V any, T any](m map[K]V, mapper func(item K) T) []T ``` -示例:[运行](https://go.dev/play/p/hI371iB8Up8) +示例:[运行](https://go.dev/play/p/hI371iB8Up8) ```go package main @@ -658,7 +656,7 @@ func main() { func ValuesBy[K comparable, V any, T any](m map[K]V, mapper func(item V) T) []T ``` -示例:[运行](https://go.dev/play/p/sg9-oRidh8f) +示例:[运行](https://go.dev/play/p/sg9-oRidh8f) ```go package main @@ -707,7 +705,7 @@ func main() { func MapKeys[K comparable, V any, T comparable](m map[K]V, iteratee func(key K, value V) T) map[T]V ``` -示例:[运行](https://go.dev/play/p/8scDxWeBDKd) +示例:[运行](https://go.dev/play/p/8scDxWeBDKd) ```go package main @@ -746,7 +744,7 @@ func main() { func MapValues[K comparable, V any, T any](m map[K]V, iteratee func(key K, value V) T) map[K]T ``` -示例:[运行](https://go.dev/play/p/g92aY3fc7Iw) +示例:[运行](https://go.dev/play/p/g92aY3fc7Iw) ```go package main @@ -789,7 +787,7 @@ type Entry[K comparable, V any] struct { func Entries[K comparable, V any](m map[K]V) []Entry[K, V] ``` -示例:[运行](https://go.dev/play/p/Ltb11LNcElY) +示例:[运行](https://go.dev/play/p/Ltb11LNcElY) ```go package main @@ -834,7 +832,7 @@ type Entry[K comparable, V any] struct { func FromEntries[K comparable, V any](entries []Entry[K, V]) map[K]V ``` -示例:[运行](https://go.dev/play/p/C8L4ul9TVwf) +示例:[运行](https://go.dev/play/p/C8L4ul9TVwf) ```go package main @@ -868,7 +866,7 @@ func main() { func Transform[K1 comparable, V1 any, K2 comparable, V2 any](m map[K1]V1, iteratee func(key K1, value V1) (K2, V2)) map[K2]V2 ``` -示例:[运行](https://go.dev/play/p/P6ovfToM3zj) +示例:[运行](https://go.dev/play/p/P6ovfToM3zj) ```go package main @@ -907,7 +905,7 @@ func main() { func IsDisjoint[K comparable, V any](mapA, mapB map[K]V) bool ``` -示例:[运行](https://go.dev/play/p/N9qgYg_Ho6f) +示例:[运行](https://go.dev/play/p/N9qgYg_Ho6f) ```go package main @@ -962,7 +960,7 @@ if haskey { func HasKey[K comparable, V any](m map[K]V, key K) bool ``` -示例:[运行](https://go.dev/play/p/isZZHOsDhFc) +示例:[运行](https://go.dev/play/p/isZZHOsDhFc) ```go package main @@ -1001,7 +999,7 @@ func main() { func NewConcurrentMap[K comparable, V any](shardCount int) *ConcurrentMap[K, V] ``` -示例:[运行](https://go.dev/play/p/3PenTPETJT0) +示例:[运行](https://go.dev/play/p/3PenTPETJT0) ```go package main @@ -1027,7 +1025,7 @@ func main() { func (cm *ConcurrentMap[K, V]) Set(key K, value V) ``` -示例:[运行](https://go.dev/play/p/3PenTPETJT0) +示例:[运行](https://go.dev/play/p/3PenTPETJT0) ```go package main @@ -1081,7 +1079,7 @@ func main() { func (cm *ConcurrentMap[K, V]) Get(key K) (V, bool) ``` -示例:[运行](https://go.dev/play/p/3PenTPETJT0) +示例:[运行](https://go.dev/play/p/3PenTPETJT0) ```go package main @@ -1135,7 +1133,7 @@ func main() { func (cm *ConcurrentMap[K, V]) GetOrSet(key K, value V) (actual V, ok bool) ``` -示例:[运行](https://go.dev/play/p/aDcDApOK01a) +示例:[运行](https://go.dev/play/p/aDcDApOK01a) ```go package main @@ -1179,7 +1177,7 @@ func main() { func (cm *ConcurrentMap[K, V]) Delete(key K) ``` -示例:[运行](https://go.dev/play/p/uTIJZYhpVMS) +示例:[运行](https://go.dev/play/p/uTIJZYhpVMS) ```go package main @@ -1225,7 +1223,7 @@ func main() { func (cm *ConcurrentMap[K, V]) GetAndDelete(key K) (actual V, ok bool) ``` -示例:[运行](https://go.dev/play/p/ZyxeIXSZUiM) +示例:[运行](https://go.dev/play/p/ZyxeIXSZUiM) ```go package main @@ -1276,7 +1274,7 @@ func main() { func (cm *ConcurrentMap[K, V]) Has(key K) bool ``` -示例:[运行](https://go.dev/play/p/C8L4ul9TVwf) +示例:[运行](https://go.dev/play/p/C8L4ul9TVwf) ```go package main @@ -1324,7 +1322,7 @@ func main() { func (cm *ConcurrentMap[K, V]) Range(iterator func(key K, value V) bool) ``` -示例:[运行](https://go.dev/play/p/iqcy7P8P0Pr) +示例:[运行](https://go.dev/play/p/iqcy7P8P0Pr) ```go package main diff --git a/docs/api/packages/mathutil.md b/docs/api/packages/mathutil.md index dca83cd..d065364 100644 --- a/docs/api/packages/mathutil.md +++ b/docs/api/packages/mathutil.md @@ -50,8 +50,6 @@ import (
- - ## 文档 ### Average @@ -64,7 +62,7 @@ import ( func Average[T constraints.Integer | constraints.Float](numbers ...T) T ``` -示例:[运行](https://go.dev/play/p/HFd70x4DrMj) +示例:[运行](https://go.dev/play/p/HFd70x4DrMj) ```go package main @@ -99,7 +97,7 @@ func main() { func Exponent(x, n int64) int64 ``` -示例:[运行](https://go.dev/play/p/Vv7LBwER-pz) +示例:[运行](https://go.dev/play/p/Vv7LBwER-pz) ```go package main @@ -135,7 +133,7 @@ func main() { func Fibonacci(first, second, n int) int ``` -示例:[运行](https://go.dev/play/p/IscseUNMuUc) +示例:[运行](https://go.dev/play/p/IscseUNMuUc) ```go package main @@ -171,7 +169,7 @@ func main() { func Factorial(x uint) uint ``` -示例:[运行](https://go.dev/play/p/tt6LdOK67Nx) +示例:[运行](https://go.dev/play/p/tt6LdOK67Nx) ```go package main @@ -207,7 +205,7 @@ func main() { func Max[T constraints.Integer | constraints.Float](numbers ...T) T ``` -示例:[运行](https://go.dev/play/p/cN8DHI0rTkH) +示例:[运行](https://go.dev/play/p/cN8DHI0rTkH) ```go package main @@ -240,7 +238,7 @@ func main() { func MaxBy[T any](slice []T, comparator func(T, T) bool) T ``` -示例:[运行](https://go.dev/play/p/pbe2MT-7DV2) +示例:[运行](https://go.dev/play/p/pbe2MT-7DV2) ```go package main @@ -284,7 +282,7 @@ func main() { func Min[T constraints.Integer | constraints.Float](numbers ...T) T ``` -示例:[运行](https://go.dev/play/p/pbe2MT-7DV2) +示例:[运行](https://go.dev/play/p/pbe2MT-7DV2) ```go package main @@ -317,7 +315,7 @@ func main() { func MinBy[T any](slice []T, comparator func(T, T) bool) T ``` -示例:[运行](https://go.dev/play/p/N9qgYg_Ho6f) +示例:[运行](https://go.dev/play/p/N9qgYg_Ho6f) ```go package main @@ -361,7 +359,7 @@ func main() { func Percent(val, total float64, n int) float64 ``` -示例:[运行](https://go.dev/play/p/s0NdFCtwuyd) +示例:[运行](https://go.dev/play/p/s0NdFCtwuyd) ```go package main @@ -397,7 +395,7 @@ func main() { func RoundToFloat(x float64, n int) float64 ``` -示例:[运行](https://go.dev/play/p/ghyb528JRJL) +示例:[运行](https://go.dev/play/p/ghyb528JRJL) ```go package main @@ -433,7 +431,7 @@ func main() { func RoundToString(x float64, n int) string ``` -示例:[运行](https://go.dev/play/p/kZwpBRAcllO) +示例:[运行](https://go.dev/play/p/kZwpBRAcllO) ```go package main @@ -469,7 +467,7 @@ func main() { func TruncRound(x float64, n int) float64 ``` -示例:[运行](https://go.dev/play/p/aumarSHIGzP) +示例:[运行](https://go.dev/play/p/aumarSHIGzP) ```go package main @@ -505,7 +503,7 @@ func main() { func Range[T constraints.Integer | constraints.Float](start T, count int) []T ``` -示例:[运行](https://go.dev/play/p/9ke2opxa8ZP) +示例:[运行](https://go.dev/play/p/9ke2opxa8ZP) ```go package main @@ -544,7 +542,7 @@ func main() { func RangeWithStep[T constraints.Integer | constraints.Float](start, end, step T) []T ``` -示例:[运行](https://go.dev/play/p/akLWz0EqOSM) +示例:[运行](https://go.dev/play/p/akLWz0EqOSM) ```go package main @@ -583,7 +581,7 @@ func main() { func AngleToRadian(angle float64) float64 ``` -示例:[运行](https://go.dev/play/p/CIvlICqrHql) +示例:[运行](https://go.dev/play/p/CIvlICqrHql) ```go package main @@ -619,7 +617,7 @@ func main() { func RadianToAngle(radian float64) float64 ``` -示例:[运行](https://go.dev/play/p/dQtmOTUOMgi) +示例:[运行](https://go.dev/play/p/dQtmOTUOMgi) ```go package main @@ -655,7 +653,7 @@ func main() { func PointDistance(x1, y1, x2, y2 float64) float64 ``` -示例:[运行](https://go.dev/play/p/RrG4JIaziM8) +示例:[运行](https://go.dev/play/p/RrG4JIaziM8) ```go package main @@ -685,7 +683,7 @@ func main() { func IsPrime(n int) bool ``` -示例:[运行](https://go.dev/play/p/Rdd8UTHZJ7u) +示例:[运行](https://go.dev/play/p/Rdd8UTHZJ7u) ```go package main @@ -724,7 +722,7 @@ func main() { func GCD[T constraints.Integer](integers ...T) T ``` -示例:[运行](https://go.dev/play/p/CiEceLSoAKB) +示例:[运行](https://go.dev/play/p/CiEceLSoAKB) ```go package main @@ -766,7 +764,7 @@ func main() { func LCM[T constraints.Integer](integers ...T) T ``` -示例:[运行](https://go.dev/play/p/EjcZxfY7G_g) +示例:[运行](https://go.dev/play/p/EjcZxfY7G_g) ```go package main @@ -802,7 +800,7 @@ func main() { func Cos(radian float64, precision ...int) float64 ``` -示例:[运行](https://go.dev/play/p/Sm89LoIfvFq) +示例:[运行](https://go.dev/play/p/Sm89LoIfvFq) ```go package main @@ -844,7 +842,7 @@ func main() { func Sin(radian float64, precision ...int) float64 ``` -示例:[运行](https://go.dev/play/p/TWMQlMywDsP) +示例:[运行](https://go.dev/play/p/TWMQlMywDsP) ```go package main @@ -886,7 +884,7 @@ func main() { func Log(n, base float64) float64 ``` -示例:[运行](https://go.dev/play/p/_d4bi8oyhat) +示例:[运行](https://go.dev/play/p/_d4bi8oyhat) ```go package main @@ -922,7 +920,7 @@ func main() { func Sum[T constraints.Integer | constraints.Float](numbers ...T) T ``` -示例:[运行](https://go.dev/play/p/1To2ImAMJA7) +示例:[运行](https://go.dev/play/p/1To2ImAMJA7) ```go package main @@ -955,7 +953,7 @@ func main() { func Abs[T constraints.Integer | constraints.Float](x T) T ``` -示例:[运行](https://go.dev/play/p/fsyBh1Os-1d) +示例:[运行](https://go.dev/play/p/fsyBh1Os-1d) ```go package main diff --git a/docs/api/packages/netutil.md b/docs/api/packages/netutil.md index 249a310..321f504 100644 --- a/docs/api/packages/netutil.md +++ b/docs/api/packages/netutil.md @@ -51,8 +51,6 @@ import (
- - ## 文档 ### ConvertMapToQueryString @@ -65,7 +63,7 @@ import ( func ConvertMapToQueryString(param map[string]any) string ``` -示例:[运行](https://go.dev/play/p/jnNt_qoSnRi) +示例:[运行](https://go.dev/play/p/jnNt_qoSnRi) ```go package main @@ -100,7 +98,7 @@ func main() { func EncodeUrl(urlStr string) (string, error) ``` -示例:[运行](https://go.dev/play/p/bsZ6BRC4uKI) +示例:[运行](https://go.dev/play/p/bsZ6BRC4uKI) ```go package main @@ -135,7 +133,7 @@ func main() { func GetInternalIp() string ``` -示例:[运行](https://go.dev/play/p/fxnna_LLD9u) +示例:[运行](https://go.dev/play/p/fxnna_LLD9u) ```go package main @@ -167,7 +165,7 @@ func main() { func GetIps() []string ``` -示例:[运行](https://go.dev/play/p/NUFfcEmukx1) +示例:[运行](https://go.dev/play/p/NUFfcEmukx1) ```go package main @@ -197,7 +195,7 @@ func main() { func GetMacAddrs() []string { ``` -示例:[运行](https://go.dev/play/p/Rq9UUBS_Xp1) +示例:[运行](https://go.dev/play/p/Rq9UUBS_Xp1) ```go package main @@ -241,7 +239,7 @@ type PublicIpInfo struct { } ``` -示例:[运行](https://go.dev/play/p/YDxIfozsRHR) +示例:[运行](https://go.dev/play/p/YDxIfozsRHR) ```go package main @@ -271,7 +269,7 @@ func main() { func GetRequestPublicIp(req *http.Request) string ``` -示例:[运行](https://go.dev/play/p/kxU-YDc_eBo) +示例:[运行](https://go.dev/play/p/kxU-YDc_eBo) ```go package main @@ -309,7 +307,7 @@ func main() { func IsPublicIP(IP net.IP) bool ``` -示例:[运行](https://go.dev/play/p/nmktSQpJZnn) +示例:[运行](https://go.dev/play/p/nmktSQpJZnn) ```go package main @@ -346,7 +344,7 @@ func main() { func IsInternalIP(IP net.IP) bool ``` -示例:[运行](https://go.dev/play/p/sYGhXbgO4Cb) +示例:[运行](https://go.dev/play/p/sYGhXbgO4Cb) ```go package main @@ -390,7 +388,7 @@ type HttpRequest struct { } ``` -示例:[运行](https://go.dev/play/p/jUSgynekH7G) +示例:[运行](https://go.dev/play/p/jUSgynekH7G) ```go package main @@ -447,7 +445,7 @@ func NewHttpClientWithConfig(config *HttpClientConfig) *HttpClient ``` -示例:[运行](https://go.dev/play/p/jUSgynekH7G) +示例:[运行](https://go.dev/play/p/jUSgynekH7G) ```go package main @@ -478,7 +476,7 @@ func main() { func (client *HttpClient) SendRequest(request *HttpRequest) (*http.Response, error) ``` -示例:[运行](https://go.dev/play/p/jUSgynekH7G) +示例:[运行](https://go.dev/play/p/jUSgynekH7G) ```go package main @@ -532,7 +530,7 @@ func main() { func (client *HttpClient) DecodeResponse(resp *http.Response, target any) error ``` -示例:[运行](https://go.dev/play/p/jUSgynekH7G) +示例:[运行](https://go.dev/play/p/jUSgynekH7G) ```go package main @@ -586,7 +584,7 @@ func main() { func StructToUrlValues(targetStruct any) url.Values ``` -示例:[运行](https://go.dev/play/p/pFqMkM40w9z) +示例:[运行](https://go.dev/play/p/pFqMkM40w9z) ```go package main @@ -968,7 +966,7 @@ func main() { func IsPingConnected(host string) bool ``` -示例:[运行](https://go.dev/play/p/q8OzTijsA87) +示例:[运行](https://go.dev/play/p/q8OzTijsA87) ```go package main @@ -1001,7 +999,7 @@ func main() { func IsTelnetConnected(host string, port string) bool ``` -示例:[运行](https://go.dev/play/p/yiLCGtQv_ZG) +示例:[运行](https://go.dev/play/p/yiLCGtQv_ZG) ```go package main diff --git a/docs/api/packages/pointer.md b/docs/api/packages/pointer.md index 827062a..8fa147f 100644 --- a/docs/api/packages/pointer.md +++ b/docs/api/packages/pointer.md @@ -30,8 +30,6 @@ import (
- - ## 文档 ### Of @@ -44,7 +42,7 @@ import ( func Of[T any](v T) *T ``` -示例:[运行](https://go.dev/play/p/HFd70x4DrMj) +示例:[运行](https://go.dev/play/p/HFd70x4DrMj) ```go package main @@ -77,7 +75,7 @@ func main() { func Unwrap[T any](p *T) T ``` -示例:[运行](https://go.dev/play/p/cgeu3g7cjWb) +示例:[运行](https://go.dev/play/p/cgeu3g7cjWb) ```go package main @@ -113,7 +111,7 @@ func main() { func ExtractPointer(value any) any ``` -示例:[运行](https://go.dev/play/p/D7HFjeWU2ZP) +示例:[运行](https://go.dev/play/p/D7HFjeWU2ZP) ```go package main @@ -148,7 +146,7 @@ func main() { UnwarpOr[T any](p *T, fallback T) T ``` -示例:[运行](https://go.dev/play/p/mmNaLC38W8C) +示例:[运行](https://go.dev/play/p/mmNaLC38W8C) ```go package main @@ -193,7 +191,7 @@ func main() { UnwarpOrDefault[T any](p *T) T ``` -示例:[运行](https://go.dev/play/p/ZnGIHf8_o4E) +示例:[运行](https://go.dev/play/p/ZnGIHf8_o4E) ```go package main diff --git a/docs/api/packages/random.md b/docs/api/packages/random.md index 28c3e95..7dcd2d2 100644 --- a/docs/api/packages/random.md +++ b/docs/api/packages/random.md @@ -34,8 +34,6 @@ import (
- - ## 文档 ### RandBytes diff --git a/docs/api/packages/retry.md b/docs/api/packages/retry.md index f61bf41..52bf908 100644 --- a/docs/api/packages/retry.md +++ b/docs/api/packages/retry.md @@ -30,7 +30,6 @@ import (
- ## 文档 @@ -44,7 +43,7 @@ import ( func Context(ctx context.Context) ``` -示例:[运行](https://go.dev/play/p/xnAOOXv9GkS) +示例:[运行](https://go.dev/play/p/xnAOOXv9GkS) ```go import ( @@ -91,7 +90,7 @@ func main() { type RetryFunc func() error ``` -示例:[运行](https://go.dev/play/p/nk2XRmagfVF) +示例:[运行](https://go.dev/play/p/nk2XRmagfVF) ```go package main @@ -137,7 +136,7 @@ func main() { func RetryTimes(n uint) ``` -示例:[运行](https://go.dev/play/p/ssfVeU2SwLO) +示例:[运行](https://go.dev/play/p/ssfVeU2SwLO) ```go package main @@ -180,7 +179,7 @@ func main() { func RetryDuration(d time.Duration) ``` -示例:[运行](https://go.dev/play/p/nk2XRmagfVF) +示例:[运行](https://go.dev/play/p/nk2XRmagfVF) ```go package main @@ -226,7 +225,7 @@ func main() { func Retry(retryFunc RetryFunc, opts ...Option) error ``` -示例:[运行](https://go.dev/play/p/nk2XRmagfVF) +示例:[运行](https://go.dev/play/p/nk2XRmagfVF) ```go package main diff --git a/docs/api/packages/slice.md b/docs/api/packages/slice.md index 7d87432..3037c6e 100644 --- a/docs/api/packages/slice.md +++ b/docs/api/packages/slice.md @@ -94,7 +94,6 @@ import (
- ## 文档 @@ -108,7 +107,7 @@ import ( func AppendIfAbsent[T comparable](slice []T, item T) []T ``` -示例:[运行](https://go.dev/play/p/GNdv7Jg2Taj) +示例:[运行](https://go.dev/play/p/GNdv7Jg2Taj) ```go import ( @@ -139,7 +138,7 @@ func main() { func Contain[T comparable](slice []T, target T) bool ``` -示例:[运行](https://go.dev/play/p/_454yEHcNjf) +示例:[运行](https://go.dev/play/p/_454yEHcNjf) ```go import ( @@ -170,7 +169,7 @@ func main() { func ContainBy[T any](slice []T, predicate func(item T) bool) bool ``` -示例:[运行](https://go.dev/play/p/49tkHfX4GNc) +示例:[运行](https://go.dev/play/p/49tkHfX4GNc) ```go import ( @@ -215,7 +214,7 @@ func main() { func ContainSubSlice[T comparable](slice, subSlice []T) bool ``` -示例:[运行](https://go.dev/play/p/bcuQ3UT6Sev) +示例:[运行](https://go.dev/play/p/bcuQ3UT6Sev) ```go import ( @@ -246,7 +245,7 @@ func main() { func Chunk[T any](slice []T, size int) [][]T ``` -示例:[运行](https://go.dev/play/p/b4Pou5j2L_C) +示例:[运行](https://go.dev/play/p/b4Pou5j2L_C) ```go import ( @@ -288,7 +287,7 @@ func main() { func Compact[T comparable](slice []T) []T ``` -示例:[运行](https://go.dev/play/p/pO5AnxEr3TK) +示例:[运行](https://go.dev/play/p/pO5AnxEr3TK) ```go import ( @@ -325,7 +324,7 @@ func main() { func Concat[T any](slice []T, slices ...[]T) []T ``` -示例:[运行](https://go.dev/play/p/gPt-q7zr5mk) +示例:[运行](https://go.dev/play/p/gPt-q7zr5mk) ```go import ( @@ -356,7 +355,7 @@ func main() { func Count[T comparable](slice []T, item T) int ``` -示例:[运行](https://go.dev/play/p/Mj4oiEnQvRJ) +示例:[运行](https://go.dev/play/p/Mj4oiEnQvRJ) ```go import ( @@ -389,7 +388,7 @@ func main() { func CountBy[T any](slice []T, predicate func(index int, item T) bool) int ``` -示例:[运行](https://go.dev/play/p/tHOccTMDZCC) +示例:[运行](https://go.dev/play/p/tHOccTMDZCC) ```go import ( @@ -423,7 +422,7 @@ func main() { func Difference[T comparable](slice, comparedSlice []T) []T ``` -示例:[运行](https://go.dev/play/p/VXvadzLzhDa) +示例:[运行](https://go.dev/play/p/VXvadzLzhDa) ```go import ( @@ -454,7 +453,7 @@ func main() { func DifferenceBy[T comparable](slice []T, comparedSlice []T, iteratee func(index int, item T) T) []T ``` -示例:[运行](https://go.dev/play/p/DiivgwM5OnC) +示例:[运行](https://go.dev/play/p/DiivgwM5OnC) ```go import ( @@ -489,7 +488,7 @@ func main() { func DifferenceWith[T any](slice []T, comparedSlice []T, comparator func(value, otherValue T) bool) []T ``` -示例:[运行](https://go.dev/play/p/v2U2deugKuV) +示例:[运行](https://go.dev/play/p/v2U2deugKuV) ```go import ( @@ -524,7 +523,7 @@ func main() { func DeleteAt[T any](slice []T, start int, end ...int) ``` -示例:[运行](https://go.dev/play/p/pJ-d6MUWcvK) +示例:[运行](https://go.dev/play/p/pJ-d6MUWcvK) ```go import ( @@ -559,7 +558,7 @@ func main() { func Drop[T any](slice []T, n int) []T ``` -示例:[运行](https://go.dev/play/p/jnPO2yQsT8H) +示例:[运行](https://go.dev/play/p/jnPO2yQsT8H) ```go import ( @@ -596,7 +595,7 @@ func main() { func DropRight[T any](slice []T, n int) []T ``` -示例:[运行](https://go.dev/play/p/8bcXvywZezG) +示例:[运行](https://go.dev/play/p/8bcXvywZezG) ```go import ( @@ -633,7 +632,7 @@ func main() { func DropWhile[T any](slice []T, predicate func(item T) bool) []T ``` -示例:[运行](https://go.dev/play/p/4rt252UV_qs) +示例:[运行](https://go.dev/play/p/4rt252UV_qs) ```go import ( @@ -673,7 +672,7 @@ func main() { func DropRightWhile[T any](slice []T, predicate func(item T) bool) []T ``` -示例:[运行](https://go.dev/play/p/6wyK3zMY56e) +示例:[运行](https://go.dev/play/p/6wyK3zMY56e) ```go import ( @@ -715,7 +714,7 @@ func main() { func Every[T any](slice []T, predicate func(index int, item T) bool) bool ``` -示例:[运行](https://go.dev/play/p/R8U6Sl-j8cD) +示例:[运行](https://go.dev/play/p/R8U6Sl-j8cD) ```go import ( @@ -749,7 +748,7 @@ func main() { func Equal[T comparable](slice1, slice2 []T) bool ``` -示例:[运行](https://go.dev/play/p/WcRQJ37ifPa) +示例:[运行](https://go.dev/play/p/WcRQJ37ifPa) ```go import ( @@ -784,7 +783,7 @@ func main() { func EqualWith[T, U any](slice1 []T, slice2 []U, comparator func(T, U) bool) bool ``` -示例:[运行](https://go.dev/play/p/b9iygtgsHI1) +示例:[运行](https://go.dev/play/p/b9iygtgsHI1) ```go import ( @@ -819,7 +818,7 @@ func main() { func Filter[T any](slice []T, predicate func(index int, item T) bool) []T ``` -示例:[运行](https://go.dev/play/p/SdPna-7qK4T) +示例:[运行](https://go.dev/play/p/SdPna-7qK4T) ```go import ( @@ -853,7 +852,7 @@ func main() { func Find[T any](slice []T, predicate func(index int, item T) bool) (*T, bool) ``` -示例:[运行](https://go.dev/play/p/CBKeBoHVLgq) +示例:[运行](https://go.dev/play/p/CBKeBoHVLgq) ```go import ( @@ -889,7 +888,7 @@ func main() { func FindBy[T any](slice []T, predicate func(index int, item T) bool) (v T, ok bool) ``` -示例:[运行](https://go.dev/play/p/n1lysBYl-GB) +示例:[运行](https://go.dev/play/p/n1lysBYl-GB) ```go import ( @@ -925,7 +924,7 @@ func main() { func FindLast[T any](slice []T, predicate func(index int, item T) bool) (*T, bool) ``` -示例:[运行](https://go.dev/play/p/FFDPV_j7URd) +示例:[运行](https://go.dev/play/p/FFDPV_j7URd) ```go import ( @@ -961,7 +960,7 @@ func main() { func FindLastBy[T any](slice []T, predicate func(index int, item T) bool) (v T, ok bool) ``` -示例:[运行](https://go.dev/play/p/8iqomzyCl_s) +示例:[运行](https://go.dev/play/p/8iqomzyCl_s) ```go import ( @@ -997,7 +996,7 @@ func main() { func Flatten(slice any) any ``` -示例:[运行](https://go.dev/play/p/hYa3cBEevtm) +示例:[运行](https://go.dev/play/p/hYa3cBEevtm) ```go import ( @@ -1027,7 +1026,7 @@ func main() { func FlattenDeep(slice any) any ``` -示例:[运行](https://go.dev/play/p/yjYNHPyCFaF) +示例:[运行](https://go.dev/play/p/yjYNHPyCFaF) ```go import ( @@ -1057,7 +1056,7 @@ func main() { func ForEach[T any](slice []T, iteratee func(index int, item T)) ``` -示例:[运行](https://go.dev/play/p/DrPaa4YsHRF) +示例:[运行](https://go.dev/play/p/DrPaa4YsHRF) ```go import ( @@ -1092,7 +1091,7 @@ func main() { func ForEachWithBreak[T any](slice []T, iteratee func(index int, item T) bool) ``` -示例:[运行](https://go.dev/play/p/qScs39f3D9W) +示例:[运行](https://go.dev/play/p/qScs39f3D9W) ```go import ( @@ -1130,7 +1129,7 @@ func main() { func GroupBy[T any](slice []T, groupFn func(index int, item T) bool) ([]T, []T) ``` -示例:[运行](https://go.dev/play/p/QVkPxzPR0iA) +示例:[运行](https://go.dev/play/p/QVkPxzPR0iA) ```go import ( @@ -1166,7 +1165,7 @@ func main() { func GroupWith[T any, U comparable](slice []T, iteratee func(T) U) map[U][]T ``` -示例:[运行](https://go.dev/play/p/ApCvMNTLO8a) +示例:[运行](https://go.dev/play/p/ApCvMNTLO8a) ```go import ( @@ -1200,7 +1199,7 @@ func main() { func IntSlice(slice any) []int ``` -示例:[运行](https://go.dev/play/p/UQDj-on9TGN) +示例:[运行](https://go.dev/play/p/UQDj-on9TGN) ```go import ( @@ -1229,7 +1228,7 @@ func main() { func InterfaceSlice(slice any) []any ``` -示例:[运行](https://go.dev/play/p/FdQXF0Vvqs-) +示例:[运行](https://go.dev/play/p/FdQXF0Vvqs-) ```go import ( @@ -1258,7 +1257,7 @@ func main() { func Intersection[T comparable](slices ...[]T) []T ``` -示例:[运行](https://go.dev/play/p/anJXfB5wq_t) +示例:[运行](https://go.dev/play/p/anJXfB5wq_t) ```go import ( @@ -1289,7 +1288,7 @@ func main() { func InsertAt[T any](slice []T, index int, value any) []T ``` -示例:[运行](https://go.dev/play/p/hMLNxPEGJVE) +示例:[运行](https://go.dev/play/p/hMLNxPEGJVE) ```go import ( @@ -1329,7 +1328,7 @@ func main() { func IndexOf[T comparable](slice []T, item T) int ``` -示例:[运行](https://go.dev/play/p/MRN1f0FpABb) +示例:[运行](https://go.dev/play/p/MRN1f0FpABb) ```go import ( @@ -1362,7 +1361,7 @@ func main() { func LastIndexOf[T comparable](slice []T, item T) int ``` -示例:[运行](https://go.dev/play/p/DokM4cf1IKH) +示例:[运行](https://go.dev/play/p/DokM4cf1IKH) ```go import ( @@ -1395,7 +1394,7 @@ func main() { func Map[T any, U any](slice []T, iteratee func(index int, item T) U) []U ``` -示例:[运行](https://go.dev/play/p/biaTefqPquw) +示例:[运行](https://go.dev/play/p/biaTefqPquw) ```go import ( @@ -1429,7 +1428,7 @@ func main() { func FilterMap[T any, U any](slice []T, iteratee func(index int, item T) (U, bool)) []U ``` -示例:[运行](https://go.dev/play/p/J94SZ_9MiIe) +示例:[运行](https://go.dev/play/p/J94SZ_9MiIe) ```go import ( @@ -1466,7 +1465,7 @@ func main() { func FlatMap[T any, U any](slice []T, iteratee func(index int, item T) []U) []U ``` -示例:[运行](https://go.dev/play/p/_QARWlWs1N_F) +示例:[运行](https://go.dev/play/p/_QARWlWs1N_F) ```go import ( @@ -1499,7 +1498,7 @@ func main() { func Merge[T any](slices ...[]T) []T ``` -示例:[运行](https://go.dev/play/p/lbjFp784r9N) +示例:[运行](https://go.dev/play/p/lbjFp784r9N) ```go import ( @@ -1530,7 +1529,7 @@ func main() { func Reverse[T any](slice []T) ``` -示例:[运行](https://go.dev/play/p/8uI8f1lwNrQ) +示例:[运行](https://go.dev/play/p/8uI8f1lwNrQ) ```go import ( @@ -1560,7 +1559,7 @@ func main() { func Reduce[T any](slice []T, iteratee func(index int, item1, item2 T) T, initial T) T ``` -示例:[运行](https://go.dev/play/p/_RfXJJWIsIm) +示例:[运行](https://go.dev/play/p/_RfXJJWIsIm) ```go import ( @@ -1594,7 +1593,7 @@ func main() { func ReduceBy[T any, U any](slice []T, initial U, reducer func(index int, item T, agg U) U) U ``` -示例:[运行](https://go.dev/play/p/YKDpLi7gtee) +示例:[运行](https://go.dev/play/p/YKDpLi7gtee) ```go import ( @@ -1630,7 +1629,7 @@ func main() { func ReduceRight[T any, U any](slice []T, initial U, reducer func(index int, item T, agg U) U) U ``` -示例:[运行](https://go.dev/play/p/qT9dZC03A1K) +示例:[运行](https://go.dev/play/p/qT9dZC03A1K) ```go import ( @@ -1660,7 +1659,7 @@ func main() { func Replace[T comparable](slice []T, old T, new T, n int) []T ``` -示例:[运行](https://go.dev/play/p/P5mZp7IhOFo) +示例:[运行](https://go.dev/play/p/P5mZp7IhOFo) ```go import ( @@ -1702,7 +1701,7 @@ func main() { func ReplaceAll[T comparable](slice []T, old T, new T) []T ``` -示例:[运行](https://go.dev/play/p/CzqXMsuYUrx) +示例:[运行](https://go.dev/play/p/CzqXMsuYUrx) ```go import ( @@ -1730,7 +1729,7 @@ func main() { func Repeat[T any](item T, n int) []T ``` -示例:[运行](https://go.dev/play/p/1CbOmtgILUU) +示例:[运行](https://go.dev/play/p/1CbOmtgILUU) ```go import ( @@ -1758,7 +1757,7 @@ func main() { func Shuffle[T any](slice []T) []T ``` -示例:[运行](https://go.dev/play/p/YHvhnWGU3Ge) +示例:[运行](https://go.dev/play/p/YHvhnWGU3Ge) ```go import ( @@ -1787,7 +1786,7 @@ func main() { func IsAscending[T constraints.Ordered](slice []T) bool ``` -示例:[运行](https://go.dev/play/p/9CtsFjet4SH) +示例:[运行](https://go.dev/play/p/9CtsFjet4SH) ```go import ( @@ -1821,7 +1820,7 @@ func main() { func IsDescending[T constraints.Ordered](slice []T) bool ``` -示例:[运行](https://go.dev/play/p/U_LljFXma14) +示例:[运行](https://go.dev/play/p/U_LljFXma14) ```go import ( @@ -1855,7 +1854,7 @@ func main() { func IsSorted[T constraints.Ordered](slice []T) bool ``` -示例:[运行](https://go.dev/play/p/nCE8wPLwSA-) +示例:[运行](https://go.dev/play/p/nCE8wPLwSA-) ```go import ( @@ -1889,7 +1888,7 @@ func main() { func IsSortedByKey[T any, K constraints.Ordered](slice []T, iteratee func(item T) K) bool ``` -示例:[运行](https://go.dev/play/p/tUoGB7DOHI4) +示例:[运行](https://go.dev/play/p/tUoGB7DOHI4) ```go import ( @@ -1929,7 +1928,7 @@ func main() { func Sort[T constraints.Ordered](slice []T, sortOrder ...string) ``` -示例:[运行](https://go.dev/play/p/V9AVjzf_4Fk) +示例:[运行](https://go.dev/play/p/V9AVjzf_4Fk) ```go import ( @@ -1966,7 +1965,7 @@ func main() { func SortBy[T any](slice []T, less func(a, b T) bool) ``` -示例:[运行](https://go.dev/play/p/DAhLQSZEumm) +示例:[运行](https://go.dev/play/p/DAhLQSZEumm) ```go import ( @@ -2013,7 +2012,7 @@ func main() { func SortByField(slice any, field string, sortType ...string) error ``` -示例:[运行](https://go.dev/play/p/fU1prOBP9p1) +示例:[运行](https://go.dev/play/p/fU1prOBP9p1) ```go import ( @@ -2054,7 +2053,7 @@ func main() { func Some[T any](slice []T, predicate func(index int, item T) bool) bool ``` -示例:[运行](https://go.dev/play/p/4pO9Xf9NDGS) +示例:[运行](https://go.dev/play/p/4pO9Xf9NDGS) ```go import ( @@ -2088,7 +2087,7 @@ func main() { func StringSlice(slice any) []string ``` -示例:[运行](https://go.dev/play/p/W0TZDWCPFcI) +示例:[运行](https://go.dev/play/p/W0TZDWCPFcI) ```go import ( @@ -2117,7 +2116,7 @@ func main() { func SymmetricDifference[T comparable](slices ...[]T) []T ``` -示例:[运行](https://go.dev/play/p/1CbOmtgILUU) +示例:[运行](https://go.dev/play/p/1CbOmtgILUU) ```go import ( @@ -2148,7 +2147,7 @@ func main() { func ToSlice[T any](items ...T) []T ``` -示例:[运行](https://go.dev/play/p/YzbzVq5kscN) +示例:[运行](https://go.dev/play/p/YzbzVq5kscN) ```go import ( @@ -2176,7 +2175,7 @@ func main() { func ToSlicePointer[T any](items ...T) []*T ``` -示例:[运行](https://go.dev/play/p/gx4tr6_VXSF) +示例:[运行](https://go.dev/play/p/gx4tr6_VXSF) ```go import ( @@ -2211,7 +2210,7 @@ func main() { func Unique[T comparable](slice []T) []T ``` -示例:[运行](https://go.dev/play/p/AXw0R3ZTE6a) +示例:[运行](https://go.dev/play/p/AXw0R3ZTE6a) ```go import ( @@ -2238,7 +2237,7 @@ func main() { func UniqueBy[T comparable](slice []T, iteratee func(item T) T) []T ``` -示例:[运行](https://go.dev/play/p/UR323iZLDpv) +示例:[运行](https://go.dev/play/p/UR323iZLDpv) ```go import ( @@ -2269,7 +2268,7 @@ func main() { func Union[T comparable](slices ...[]T) []T ``` -示例:[运行](https://go.dev/play/p/hfXV1iRIZOf) +示例:[运行](https://go.dev/play/p/hfXV1iRIZOf) ```go import ( @@ -2300,7 +2299,7 @@ func main() { func UnionBy[T any, V comparable](predicate func(item T) V, slices ...[]T) []T ``` -示例:[运行](https://go.dev/play/p/HGKHfxKQsFi) +示例:[运行](https://go.dev/play/p/HGKHfxKQsFi) ```go import ( @@ -2333,7 +2332,7 @@ func main() { func UpdateAt[T any](slice []T, index int, value T) []T ``` -示例:[运行](https://go.dev/play/p/f3mh2KloWVm) +示例:[运行](https://go.dev/play/p/f3mh2KloWVm) ```go import ( @@ -2373,7 +2372,7 @@ func main() { func Without[T comparable](slice []T, items ...T) []T ``` -示例:[运行](https://go.dev/play/p/bwhEXEypThg) +示例:[运行](https://go.dev/play/p/bwhEXEypThg) ```go import ( @@ -2401,7 +2400,7 @@ func main() { func KeyBy[T any, U comparable](slice []T, iteratee func(item T) U) map[U]T ``` -示例:[运行](https://go.dev/play/p/uXod2LWD1Kg) +示例:[运行](https://go.dev/play/p/uXod2LWD1Kg) ```go import ( @@ -2431,7 +2430,7 @@ func main() { func Join[T any](s []T, separator string) string ``` -示例:[运行](https://go.dev/play/p/huKzqwNDD7V) +示例:[运行](https://go.dev/play/p/huKzqwNDD7V) ```go import ( diff --git a/docs/api/packages/stream.md b/docs/api/packages/stream.md index d942ca4..db8393f 100644 --- a/docs/api/packages/stream.md +++ b/docs/api/packages/stream.md @@ -51,8 +51,6 @@ import (
- - ## 文档 ### Of @@ -65,7 +63,7 @@ import ( func Of[T any](elems ...T) stream[T] ``` -示例:[运行](https://go.dev/play/p/jI6_iZZuVFE) +示例:[运行](https://go.dev/play/p/jI6_iZZuVFE) ```go import ( @@ -95,7 +93,7 @@ func main() { func FromSlice[T any](source []T) stream[T] ``` -示例:[运行](https://go.dev/play/p/wywTO0XZtI4) +示例:[运行](https://go.dev/play/p/wywTO0XZtI4) ```go import ( @@ -125,7 +123,7 @@ func main() { func FromChannel[T any](source <-chan T) stream[T] ``` -示例:[运行](https://go.dev/play/p/9TZYugGMhXZ) +示例:[运行](https://go.dev/play/p/9TZYugGMhXZ) ```go import ( @@ -163,7 +161,7 @@ func main() { func FromRange[T constraints.Integer | constraints.Float](start, end, step T) stream[T] ``` -示例:[运行](https://go.dev/play/p/9Ex1-zcg-B-) +示例:[运行](https://go.dev/play/p/9Ex1-zcg-B-) ```go import ( @@ -192,7 +190,7 @@ func main() { func Generate[T any](generator func() func() (item T, ok bool)) stream[T] ``` -示例:[运行](https://go.dev/play/p/rkOWL1yA3j9) +示例:[运行](https://go.dev/play/p/rkOWL1yA3j9) ```go import ( @@ -232,7 +230,7 @@ func main() { func Concat[T any](a, b stream[T]) stream[T] ``` -示例:[运行](https://go.dev/play/p/HM4OlYk_OUC) +示例:[运行](https://go.dev/play/p/HM4OlYk_OUC) ```go import ( @@ -265,7 +263,7 @@ func main() { func (s stream[T]) Distinct() stream[T] ``` -示例:[运行](https://go.dev/play/p/eGkOSrm64cB) +示例:[运行](https://go.dev/play/p/eGkOSrm64cB) ```go import ( @@ -299,7 +297,7 @@ func main() { func (s stream[T]) Filter(predicate func(item T) bool) stream[T] ``` -示例:[运行](https://go.dev/play/p/MFlSANo-buc) +示例:[运行](https://go.dev/play/p/MFlSANo-buc) ```go import ( @@ -333,7 +331,7 @@ func main() { func (s stream[T]) Map(mapper func(item T) T) stream[T] ``` -示例:[运行](https://go.dev/play/p/OtNQUImdYko) +示例:[运行](https://go.dev/play/p/OtNQUImdYko) ```go import ( @@ -367,7 +365,7 @@ func main() { func (s stream[T]) Peek(consumer func(item T)) stream[T] ``` -示例:[运行](https://go.dev/play/p/u1VNzHs6cb2) +示例:[运行](https://go.dev/play/p/u1VNzHs6cb2) ```go import ( @@ -404,7 +402,7 @@ func main() { func (s stream[T]) Skip(n int) stream[T] ``` -示例:[运行](https://go.dev/play/p/fNdHbqjahum) +示例:[运行](https://go.dev/play/p/fNdHbqjahum) ```go import ( @@ -443,7 +441,7 @@ func main() { func (s stream[T]) Limit(maxSize int) stream[T] ``` -示例:[运行](https://go.dev/play/p/qsO4aniDcGf) +示例:[运行](https://go.dev/play/p/qsO4aniDcGf) ```go import ( @@ -482,7 +480,7 @@ func main() { func (s stream[T]) Reverse() stream[T] ``` -示例:[运行](https://go.dev/play/p/A8_zkJnLHm4) +示例:[运行](https://go.dev/play/p/A8_zkJnLHm4) ```go import ( @@ -512,7 +510,7 @@ func main() { func (s stream[T]) Range(start, end int) stream[T] ``` -示例:[运行](https://go.dev/play/p/indZY5V2f4j) +示例:[运行](https://go.dev/play/p/indZY5V2f4j) ```go import ( @@ -551,7 +549,7 @@ func main() { func (s stream[T]) Sorted(less func(a, b T) bool) stream[T] ``` -示例:[运行](https://go.dev/play/p/XXtng5uonFj) +示例:[运行](https://go.dev/play/p/XXtng5uonFj) ```go import ( @@ -583,7 +581,7 @@ func main() { func (s stream[T]) ForEach(action func(item T)) ``` -示例:[运行](https://go.dev/play/p/Dsm0fPqcidk) +示例:[运行](https://go.dev/play/p/Dsm0fPqcidk) ```go import ( @@ -616,7 +614,7 @@ func main() { func (s stream[T]) Reduce(initial T, accumulator func(a, b T) T) T ``` -示例:[运行](https://go.dev/play/p/6uzZjq_DJLU) +示例:[运行](https://go.dev/play/p/6uzZjq_DJLU) ```go import ( @@ -648,7 +646,7 @@ func main() { func (s stream[T]) FindFirst() (T, bool) ``` -示例:[运行](https://go.dev/play/p/9xEf0-6C1e3) +示例:[运行](https://go.dev/play/p/9xEf0-6C1e3) ```go import ( @@ -680,7 +678,7 @@ func main() { func (s stream[T]) FindLast() (T, bool) ``` -示例:[运行](https://go.dev/play/p/WZD2rDAW-2h) +示例:[运行](https://go.dev/play/p/WZD2rDAW-2h) ```go import ( @@ -712,7 +710,7 @@ func main() { func (s stream[T]) Max(less func(a, b T) bool) (T, bool) ``` -示例:[运行](https://go.dev/play/p/fm-1KOPtGzn) +示例:[运行](https://go.dev/play/p/fm-1KOPtGzn) ```go import ( @@ -744,7 +742,7 @@ func main() { func (s stream[T]) Min(less func(a, b T) bool) (T, bool) ``` -示例:[运行](https://go.dev/play/p/vZfIDgGNRe_0) +示例:[运行](https://go.dev/play/p/vZfIDgGNRe_0) ```go import ( @@ -776,7 +774,7 @@ func main() { func (s stream[T]) AllMatch(predicate func(item T) bool) bool ``` -示例:[运行](https://go.dev/play/p/V5TBpVRs-Cx) +示例:[运行](https://go.dev/play/p/V5TBpVRs-Cx) ```go import ( @@ -814,7 +812,7 @@ func main() { func (s stream[T]) AnyMatch(predicate func(item T) bool) bool ``` -示例:[运行](https://go.dev/play/p/PTCnWn4OxSn) +示例:[运行](https://go.dev/play/p/PTCnWn4OxSn) ```go import ( @@ -852,7 +850,7 @@ func main() { func (s stream[T]) NoneMatch(predicate func(item T) bool) bool ``` -示例:[运行](https://go.dev/play/p/iWS64pL1oo3) +示例:[运行](https://go.dev/play/p/iWS64pL1oo3) ```go import ( @@ -890,7 +888,7 @@ func main() { func (s stream[T]) Count() int ``` -示例:[运行](https://go.dev/play/p/r3koY6y_Xo-) +示例:[运行](https://go.dev/play/p/r3koY6y_Xo-) ```go import ( @@ -921,7 +919,7 @@ func main() { func (s stream[T]) ToSlice() []T ``` -示例:[运行](https://go.dev/play/p/jI6_iZZuVFE) +示例:[运行](https://go.dev/play/p/jI6_iZZuVFE) ```go import ( diff --git a/docs/api/packages/strutil.md b/docs/api/packages/strutil.md index fcec970..6c71ef2 100644 --- a/docs/api/packages/strutil.md +++ b/docs/api/packages/strutil.md @@ -62,8 +62,6 @@ import (
- - ## 文档 ### After @@ -76,7 +74,7 @@ import ( func After(s, char string) string ``` -示例:[运行](https://go.dev/play/p/RbCOQqCDA7m) +示例:[运行](https://go.dev/play/p/RbCOQqCDA7m) ```go import ( @@ -116,7 +114,7 @@ func main() { func AfterLast(s, char string) string ``` -示例:[运行](https://go.dev/play/p/1TegARrb8Yn) +示例:[运行](https://go.dev/play/p/1TegARrb8Yn) ```go import ( @@ -156,7 +154,7 @@ func main() { func Before(s, char string) string ``` -示例:[运行](https://go.dev/play/p/JAWTZDS4F5w) +示例:[运行](https://go.dev/play/p/JAWTZDS4F5w) ```go import ( @@ -193,7 +191,7 @@ func main() { func BeforeLast(s, char string) string ``` -示例:[运行](https://go.dev/play/p/pJfXXAoG_Te) +示例:[运行](https://go.dev/play/p/pJfXXAoG_Te) ```go import ( @@ -230,7 +228,7 @@ func main() { func CamelCase(s string) string ``` -示例:[运行](https://go.dev/play/p/9eXP3tn2tUy) +示例:[运行](https://go.dev/play/p/9eXP3tn2tUy) ```go import ( @@ -265,7 +263,7 @@ func main() { func KebabCase(s string) string ``` -示例:[运行](https://go.dev/play/p/dcZM9Oahw-Y) +示例:[运行](https://go.dev/play/p/dcZM9Oahw-Y) ```go import ( @@ -300,7 +298,7 @@ func main() { func UpperKebabCase(s string) string ``` -示例:[运行](https://go.dev/play/p/zDyKNneyQXk) +示例:[运行](https://go.dev/play/p/zDyKNneyQXk) ```go import ( @@ -335,7 +333,7 @@ func main() { func Capitalize(s string) string ``` -示例:[运行](https://go.dev/play/p/2OAjgbmAqHZ) +示例:[运行](https://go.dev/play/p/2OAjgbmAqHZ) ```go import ( @@ -370,7 +368,7 @@ func main() { func IsString(v any) bool ``` -示例:[运行](https://go.dev/play/p/IOgq7oF9ERm) +示例:[运行](https://go.dev/play/p/IOgq7oF9ERm) ```go import ( @@ -410,7 +408,7 @@ func main() { func LowerFirst(s string) string ``` -示例:[运行](https://go.dev/play/p/CbzAyZmtJwL) +示例:[运行](https://go.dev/play/p/CbzAyZmtJwL) ```go import ( @@ -444,7 +442,7 @@ func main() { func UpperFirst(s string) string ``` -示例:[运行](https://go.dev/play/p/sBbBxRbs8MM) +示例:[运行](https://go.dev/play/p/sBbBxRbs8MM) ```go import ( @@ -478,7 +476,7 @@ func main() { func Pad(source string, size int, padStr string) string ``` -示例:[运行](https://go.dev/play/p/NzImQq-VF8q) +示例:[运行](https://go.dev/play/p/NzImQq-VF8q) ```go import ( @@ -523,7 +521,7 @@ func main() { func PadEnd(source string, size int, padStr string) string ``` -示例:[运行](https://go.dev/play/p/9xP8rN0vz--) +示例:[运行](https://go.dev/play/p/9xP8rN0vz--) ```go import ( @@ -569,7 +567,7 @@ func main() { func PadStart(source string, size int, padStr string) string ``` -示例:[运行](https://go.dev/play/p/xpTfzArDfvT) +示例:[运行](https://go.dev/play/p/xpTfzArDfvT) ```go import ( @@ -615,7 +613,7 @@ func main() { func Reverse(s string) string ``` -示例:[运行](https://go.dev/play/p/adfwalJiecD) +示例:[运行](https://go.dev/play/p/adfwalJiecD) ```go import ( @@ -646,7 +644,7 @@ func main() { func SnakeCase(s string) string ``` -示例:[运行](https://go.dev/play/p/tgzQG11qBuN) +示例:[运行](https://go.dev/play/p/tgzQG11qBuN) ```go import ( @@ -681,7 +679,7 @@ func main() { func UpperSnakeCase(s string) string ``` -示例:[运行](https://go.dev/play/p/4COPHpnLx38) +示例:[运行](https://go.dev/play/p/4COPHpnLx38) ```go import ( @@ -716,7 +714,7 @@ func main() { func SplitEx(s, sep string, removeEmptyString bool) []string ``` -示例:[运行](https://go.dev/play/p/Us-ySSbWh-3) +示例:[运行](https://go.dev/play/p/Us-ySSbWh-3) ```go import ( @@ -757,7 +755,7 @@ func main() { func Substring(s string, offset int, length uint) string ``` -示例:[运行](https://go.dev/play/p/q3sM6ehnPDp) +示例:[运行](https://go.dev/play/p/q3sM6ehnPDp) ```go import ( @@ -800,7 +798,7 @@ func main() { func Wrap(str string, wrapWith string) string ``` -示例:[运行](https://go.dev/play/p/KoZOlZDDt9y) +示例:[运行](https://go.dev/play/p/KoZOlZDDt9y) ```go import ( @@ -837,7 +835,7 @@ func main() { func Unwrap(str string, wrapToken string) string ``` -示例:[运行](https://go.dev/play/p/Ec2q4BzCpG-) +示例:[运行](https://go.dev/play/p/Ec2q4BzCpG-) ```go import ( @@ -877,7 +875,7 @@ func main() { func SplitWords(s string) []string ``` -示例:[运行](https://go.dev/play/p/KLiX4WiysMM) +示例:[运行](https://go.dev/play/p/KLiX4WiysMM) ```go import ( @@ -920,7 +918,7 @@ func main() { func WordCount(s string) int ``` -示例:[运行](https://go.dev/play/p/bj7_odx3vRf) +示例:[运行](https://go.dev/play/p/bj7_odx3vRf) ```go import ( @@ -963,7 +961,7 @@ func main() { func RemoveNonPrintable(str string) string ``` -示例:[运行](https://go.dev/play/p/og47F5x_jTZ) +示例:[运行](https://go.dev/play/p/og47F5x_jTZ) ```go import ( @@ -994,7 +992,7 @@ func main() { func StringToBytes(str string) (b []byte) ``` -示例:[运行](https://go.dev/play/p/7OyFBrf9AxA) +示例:[运行](https://go.dev/play/p/7OyFBrf9AxA) ```go import ( @@ -1024,7 +1022,7 @@ func main() { func BytesToString(bytes []byte) string ``` -示例:[运行](https://go.dev/play/p/6c68HRvJecH) +示例:[运行](https://go.dev/play/p/6c68HRvJecH) ```go import ( @@ -1053,7 +1051,7 @@ func main() { func IsBlank(str string) bool ``` -示例:[运行](https://go.dev/play/p/6zXRH_c0Qd3) +示例:[运行](https://go.dev/play/p/6zXRH_c0Qd3) ```go import ( @@ -1087,7 +1085,7 @@ func main() { func HasPrefixAny(str string, prefixes []string) bool ``` -示例:[运行](https://go.dev/play/p/8UUTl2C5slo) +示例:[运行](https://go.dev/play/p/8UUTl2C5slo) ```go import ( @@ -1118,7 +1116,7 @@ func main() { func HasSuffixAny(str string, suffixes []string) bool ``` -示例:[运行](https://go.dev/play/p/sKWpCQdOVkx) +示例:[运行](https://go.dev/play/p/sKWpCQdOVkx) ```go import ( @@ -1149,7 +1147,7 @@ func main() { func IndexOffset(str string, substr string, idxFrom int) int ``` -示例:[运行](https://go.dev/play/p/qZo4lV2fomB) +示例:[运行](https://go.dev/play/p/qZo4lV2fomB) ```go import ( @@ -1191,7 +1189,7 @@ func main() { func ReplaceWithMap(str string, replaces map[string]string) string ``` -示例:[运行](https://go.dev/play/p/h3t7CNj2Vvu) +示例:[运行](https://go.dev/play/p/h3t7CNj2Vvu) ```go import ( @@ -1224,7 +1222,7 @@ func main() { func Trim(str string, characterMask ...string) string ``` -示例:[运行](https://go.dev/play/p/Y0ilP0NRV3j) +示例:[运行](https://go.dev/play/p/Y0ilP0NRV3j) ```go import ( @@ -1261,7 +1259,7 @@ func main() { func SplitAndTrim(str, delimiter string, characterMask ...string) []string ``` -示例:[运行](https://go.dev/play/p/ZNL6o4SkYQ7) +示例:[运行](https://go.dev/play/p/ZNL6o4SkYQ7) ```go import ( @@ -1294,7 +1292,7 @@ func main() { func HideString(origin string, start, end int, replaceChar string) string ``` -示例:[运行](https://go.dev/play/p/pzbaIVCTreZ) +示例:[运行](https://go.dev/play/p/pzbaIVCTreZ) ```go import ( @@ -1333,7 +1331,7 @@ func main() { func ContainsAll(str string, substrs []string) bool ``` -示例:[运行](https://go.dev/play/p/KECtK2Os4zq) +示例:[运行](https://go.dev/play/p/KECtK2Os4zq) ```go import ( @@ -1366,7 +1364,7 @@ func main() { func ContainsAny(str string, substrs []string) bool ``` -示例:[运行](https://go.dev/play/p/dZGSSMB3LXE) +示例:[运行](https://go.dev/play/p/dZGSSMB3LXE) ```go import ( @@ -1402,7 +1400,7 @@ func main() { func RemoveWhiteSpace(str string, repalceAll bool) string ``` -示例:[运行](https://go.dev/play/p/HzLC9vsTwkf) +示例:[运行](https://go.dev/play/p/HzLC9vsTwkf) ```go import ( diff --git a/docs/en/api/packages/algorithm.md b/docs/en/api/packages/algorithm.md index 9cef0a0..6af30e3 100644 --- a/docs/en/api/packages/algorithm.md +++ b/docs/en/api/packages/algorithm.md @@ -12,8 +12,6 @@ Package algorithm implements some basic algorithm. eg. sort, search.
- - ## Usage ```go @@ -53,7 +51,7 @@ import ( func BubbleSort[T any](slice []T, comparator lancetconstraints.Comparator) ``` -Example: [Run](https://go.dev/play/p/GNdv7Jg2Taj) +Example: [Run](https://go.dev/play/p/GNdv7Jg2Taj) ```go package main @@ -101,7 +99,7 @@ func main() { func InsertionSort[T any](slice []T, comparator lancetconstraints.Comparator) ``` -Example: [Run](https://go.dev/play/p/G5LJiWgJJW6) +Example: [Run](https://go.dev/play/p/G5LJiWgJJW6) ```go package main @@ -164,7 +162,7 @@ func main() { func SelectionSort[T any](slice []T, comparator lancetconstraints.Comparator) ``` -Example: [Run](https://go.dev/play/p/oXovbkekayS) +Example: [Run](https://go.dev/play/p/oXovbkekayS) ```go package main @@ -212,7 +210,7 @@ func main() { func ShellSort[T any](slice []T, comparator lancetconstraints.Comparator) ``` -Example: [Run](https://go.dev/play/p/3ibkszpJEu3) +Example: [Run](https://go.dev/play/p/3ibkszpJEu3) ```go package main @@ -260,7 +258,7 @@ func main() { func QuickSort[T any](slice []T comparator lancetconstraints.Comparator) ``` -Example:[Run](https://go.dev/play/p/7Y7c1Elk3ax) +Example:[Run](https://go.dev/play/p/7Y7c1Elk3ax) ```go package main @@ -308,7 +306,7 @@ func main() { func HeapSort[T any](slice []T, comparator lancetconstraints.Comparator) ``` -Example: [Run](https://go.dev/play/p/u6Iwa1VZS_f) +Example: [Run](https://go.dev/play/p/u6Iwa1VZS_f) ```go package main @@ -356,7 +354,7 @@ func main() { func MergeSort[T any](slice []T, comparator lancetconstraints.Comparator) ``` -Example: [Run](https://go.dev/play/p/ydinn9YzUJn) +Example: [Run](https://go.dev/play/p/ydinn9YzUJn) ```go package main @@ -404,7 +402,7 @@ func main() { func CountSort[T any](slice []T, comparator lancetconstraints.Comparator) []T ``` -Example: [Run](https://go.dev/play/p/tB-Umgm0DrP) +Example: [Run](https://go.dev/play/p/tB-Umgm0DrP) ```go package main @@ -453,7 +451,7 @@ func main() { func BinarySearch[T any](sortedSlice []T, target T, lowIndex, highIndex int, comparator lancetconstraints.Comparator) int ``` -Example: [Run](https://go.dev/play/p/t6MeGiUSN47) +Example: [Run](https://go.dev/play/p/t6MeGiUSN47) ```go package main @@ -504,7 +502,7 @@ func main() { func BinaryIterativeSearch[T any](sortedSlice []T, target T, lowIndex, highIndex int, comparator lancetconstraints.Comparator) int ``` -Example: [Run](https://go.dev/play/p/Anozfr8ZLH3) +Example: [Run](https://go.dev/play/p/Anozfr8ZLH3) ```go package main @@ -555,7 +553,7 @@ func main() { func LinearSearch[T any](slice []T, target T, equal func(a, b T) bool) int ``` -Example: [Run](https://go.dev/play/p/IsS7rgn5s3x) +Example: [Run](https://go.dev/play/p/IsS7rgn5s3x) ```go package main @@ -598,7 +596,7 @@ func (l *LRUCache[K, V]) Delete(key K) bool func (l *LRUCache[K, V]) Len() int ``` -Example: [Run](https://go.dev/play/p/IsS7rgn5s3x) +Example: [Run](https://go.dev/play/p/IsS7rgn5s3x) ```go package main diff --git a/docs/en/api/packages/compare.md b/docs/en/api/packages/compare.md index d593ff4..84f56e6 100644 --- a/docs/en/api/packages/compare.md +++ b/docs/en/api/packages/compare.md @@ -34,15 +34,13 @@ import (
- - ## Documentation ### Equal

Checks if two values are equal or not. (check both type and value)

-Signature: [Run](https://go.dev/play/p/wmVxR-to4lz) +Signature: [Run](https://go.dev/play/p/wmVxR-to4lz) ```go func Equal(left, right any) bool @@ -91,7 +89,7 @@ func main() {

Checks if two values are equal or not. (check value only)

-Signature: [Run](https://go.dev/play/p/fxnna_LLD9u) +Signature: [Run](https://go.dev/play/p/fxnna_LLD9u) ```go func EqualValue(left, right any) bool @@ -130,7 +128,7 @@ func main() {

Checks if value `left` less than value `right`.

-Signature: [Run](https://go.dev/play/p/cYh7FQQj0ne) +Signature: [Run](https://go.dev/play/p/cYh7FQQj0ne) ```go func LessThan(left, right any) bool @@ -185,7 +183,7 @@ func main() { func GreaterThan(left, right any) bool ``` -Example: [Run](https://go.dev/play/p/9-NYDFZmIMp) +Example: [Run](https://go.dev/play/p/9-NYDFZmIMp) ```go package main @@ -237,7 +235,7 @@ func main() { func LessOrEqual(left, right any) bool ``` -Example: [Run](https://go.dev/play/p/e4T_scwoQzp) +Example: [Run](https://go.dev/play/p/e4T_scwoQzp) ```go package main @@ -280,7 +278,7 @@ func main() {

Checks if value `left` less greater or equal than value `right`.

-Signature: [Run](https://go.dev/play/p/vx8mP0U8DFk) +Signature: [Run](https://go.dev/play/p/vx8mP0U8DFk) ```go func GreaterOrEqual(left, right any) bool @@ -332,7 +330,7 @@ func main() {

Checks if two values are equal or not within a delta.

-Signature: [Run](https://go.dev/play/p/TuDdcNtMkjo) +Signature: [Run](https://go.dev/play/p/TuDdcNtMkjo) ```go func InDelta[T constraints.Integer | constraints.Float](left, right T, delta float64) bool diff --git a/docs/en/api/packages/concurrency.md b/docs/en/api/packages/concurrency.md index e022ed0..04340a2 100644 --- a/docs/en/api/packages/concurrency.md +++ b/docs/en/api/packages/concurrency.md @@ -33,8 +33,6 @@ import (
- - ## Documentation ## Channel @@ -47,7 +45,7 @@ import ( type Channel[T any] struct func NewChannel[T any]() *Channel[T] ``` -Example: [Run](https://go.dev/play/p/7aB4KyMMp9A) +Example: [Run](https://go.dev/play/p/7aB4KyMMp9A) ```go package main @@ -71,7 +69,7 @@ func main() { ```go func (c *Channel[T]) Bridge(ctx context.Context, chanStream <-chan <-chan T) <-chan T ``` -Example: [Run](https://go.dev/play/p/qmWSy1NVF-Y) +Example: [Run](https://go.dev/play/p/qmWSy1NVF-Y) ```go package main @@ -123,7 +121,7 @@ func main() { ```go func (c *Channel[T]) FanIn(ctx context.Context, channels ...<-chan T) <-chan T ``` -Example: [Run](https://go.dev/play/p/2VYFMexEvTm) +Example: [Run](https://go.dev/play/p/2VYFMexEvTm) ```go package main @@ -157,7 +155,7 @@ func main() {

Create channel, put values into the channel repeatly until cancel the context.

-Signature: [Run](https://go.dev/play/p/k5N_ALVmYjE) +Signature: [Run](https://go.dev/play/p/k5N_ALVmYjE) ```go func (c *Channel[T]) Repeat(ctx context.Context, values ...T) <-chan T @@ -201,7 +199,7 @@ func main() { ```go func (c *Channel[T]) Generate(ctx context.Context, values ...T) <-chan T ``` -Example: [Run](https://go.dev/play/p/7aB4KyMMp9A) +Example: [Run](https://go.dev/play/p/7aB4KyMMp9A) ```go package main @@ -234,7 +232,7 @@ func main() {

Create a channel, excutes fn repeatly, and put the result into the channel, until close context.

-Signature: [Run](https://go.dev/play/p/4J1zAWttP85) +Signature: [Run](https://go.dev/play/p/4J1zAWttP85) ```go func (c *Channel[T]) RepeatFn(ctx context.Context, fn func() T) <-chan T @@ -276,7 +274,7 @@ func main() {

Read one or more channels into one channel, will close when any readin channel is closed.

-Signature: [Run](https://go.dev/play/p/Wqz9rwioPww) +Signature: [Run](https://go.dev/play/p/Wqz9rwioPww) ```go func (c *Channel[T]) Or(channels ...<-chan T) <-chan T @@ -319,7 +317,7 @@ func main() {

Read a channel into another channel, will close until cancel context.

-Signature: [Run](https://go.dev/play/p/lm_GoS6aDjo) +Signature: [Run](https://go.dev/play/p/lm_GoS6aDjo) ```go func (c *Channel[T]) OrDone(ctx context.Context, channel <-chan T) <-chan T @@ -357,7 +355,7 @@ func main() {

Create a channel whose values are taken from another channel with limit number.

-Signature: [Run](https://go.dev/play/p/9Utt-1pDr2J) +Signature: [Run](https://go.dev/play/p/9Utt-1pDr2J) ```go func (c *Channel[T]) Take(ctx context.Context, valueStream <-chan T, number int) <-chan T @@ -403,7 +401,7 @@ func main() {

Split one chanel into two channels, until cancel the context.

-Signature: [Run](https://go.dev/play/p/3TQPKnCirrP) +Signature: [Run](https://go.dev/play/p/3TQPKnCirrP) ```go func (c *Channel[T]) Tee(ctx context.Context, in <-chan T) (<-chan T, <-chan T) diff --git a/docs/en/api/packages/condition.md b/docs/en/api/packages/condition.md index 0c832ff..9421248 100644 --- a/docs/en/api/packages/condition.md +++ b/docs/en/api/packages/condition.md @@ -31,8 +31,6 @@ import (
- - ## Documentation @@ -48,7 +46,7 @@ All other types are truthy if they are not their zero value.

```go func Bool[T any](value T) bool ``` -Example:[运行](https://go.dev/play/p/ETzeDJRSvhm) +Example:[运行](https://go.dev/play/p/ETzeDJRSvhm) ```go package main @@ -113,7 +111,7 @@ func main() { ```go func And[T, U any](a T, b U) bool ``` -Example:[运行](https://go.dev/play/p/W1SSUmt6pvr) +Example:[运行](https://go.dev/play/p/W1SSUmt6pvr) ```go package main @@ -141,7 +139,7 @@ func main() { ```go func Or[T, U any](a T, b U) bool ``` -Example:[运行](https://go.dev/play/p/UlQTxHaeEkq) +Example:[运行](https://go.dev/play/p/UlQTxHaeEkq) ```go package main @@ -169,7 +167,7 @@ func main() { ```go func Xor[T, U any](a T, b U) bool ``` -Example:[运行](https://go.dev/play/p/gObZrW7ZbG8) +Example:[运行](https://go.dev/play/p/gObZrW7ZbG8) ```go package main @@ -197,7 +195,7 @@ func main() { ```go func Nor[T, U any](a T, b U) bool ``` -Example:[运行](https://go.dev/play/p/g2j08F_zZky) +Example:[运行](https://go.dev/play/p/g2j08F_zZky) ```go package main @@ -224,7 +222,7 @@ func main() { ```go func Xnor[T, U any](a T, b U) bool ``` -Example:[运行](https://go.dev/play/p/OuDB9g51643) +Example:[运行](https://go.dev/play/p/OuDB9g51643) ```go package main @@ -251,7 +249,7 @@ func main() { ```go func Nand[T, U any](a T, b U) bool ``` -Example:[运行](https://go.dev/play/p/vSRMLxLIbq8) +Example:[运行](https://go.dev/play/p/vSRMLxLIbq8) ```go package main @@ -279,7 +277,7 @@ func main() { ```go func TernaryOperator[T, U any](isTrue T, ifValue U, elseValue U) U ``` -Example:[运行](https://go.dev/play/p/ElllPZY0guT) +Example:[运行](https://go.dev/play/p/ElllPZY0guT) ```go package main diff --git a/docs/en/api/packages/convertor.md b/docs/en/api/packages/convertor.md index fc90175..04bb628 100644 --- a/docs/en/api/packages/convertor.md +++ b/docs/en/api/packages/convertor.md @@ -46,8 +46,6 @@ import (
- - ## Documentation ### ColorHexToRGB @@ -60,7 +58,7 @@ import ( func ColorHexToRGB(colorHex string) (red, green, blue int) ``` -Example:[Run](https://go.dev/play/p/o7_ft-JCJBV) +Example:[Run](https://go.dev/play/p/o7_ft-JCJBV) ```go package main @@ -91,7 +89,7 @@ func main() { func ColorRGBToHex(red, green, blue int) string ``` -Example:[Run](https://go.dev/play/p/nzKS2Ro87J1) +Example:[Run](https://go.dev/play/p/nzKS2Ro87J1) ```go package main @@ -124,7 +122,7 @@ func main() { func ToBool(s string) (bool, error) ``` -Example:[Run](https://go.dev/play/p/ARht2WnGdIN) +Example:[Run](https://go.dev/play/p/ARht2WnGdIN) ```go package main @@ -165,7 +163,7 @@ func main() { func ToBytes(data any) ([]byte, error) ``` -Example:[Run](https://go.dev/play/p/fAMXYFDvOvr) +Example:[Run](https://go.dev/play/p/fAMXYFDvOvr) ```go package main @@ -198,7 +196,7 @@ func main() { func ToChar(s string) []string ``` -Example:[Run](https://go.dev/play/p/JJ1SvbFkVdM) +Example:[Run](https://go.dev/play/p/JJ1SvbFkVdM) ```go package main @@ -234,7 +232,7 @@ func main() { func ToChannel[T any](array []T) <-chan T ``` -Example:[Run](https://go.dev/play/p/hOx_oYZbAnL) +Example:[Run](https://go.dev/play/p/hOx_oYZbAnL) ```go package main @@ -271,7 +269,7 @@ func main() { func ToFloat(value any) (float64, error) ``` -Example:[Run](https://go.dev/play/p/4YTmPCibqHJ) +Example:[Run](https://go.dev/play/p/4YTmPCibqHJ) ```go package main @@ -316,7 +314,7 @@ func main() { func ToInt(value any) (int64, error) ``` -Example:[Run](https://go.dev/play/p/9_h9vIt-QZ_b) +Example:[Run](https://go.dev/play/p/9_h9vIt-QZ_b) ```go package main @@ -358,7 +356,7 @@ func main() { func ToJson(value any) (string, error) ``` -Example:[Run](https://go.dev/play/p/2rLIkMmXWvR) +Example:[Run](https://go.dev/play/p/2rLIkMmXWvR) ```go package main @@ -393,7 +391,7 @@ func main() { func ToMap[T any, K comparable, V any](array []T, iteratee func(T) (K, V)) map[K]V ``` -Example:[Run](https://go.dev/play/p/tVFy7E-t24l) +Example:[Run](https://go.dev/play/p/tVFy7E-t24l) ```go package main @@ -434,7 +432,7 @@ func main() { func ToPointer[T any](value T) *T ``` -Example:[Run](https://go.dev/play/p/ASf_etHNlw1) +Example:[Run](https://go.dev/play/p/ASf_etHNlw1) ```go package main @@ -463,7 +461,7 @@ func main() { func ToString(value any) string ``` -Example:[Run](https://go.dev/play/p/nF1zOOslpQq) +Example:[Run](https://go.dev/play/p/nF1zOOslpQq) ```go package main @@ -511,7 +509,7 @@ func main() { func StructToMap(value any) (map[string]any, error) ``` -Example:[Run](https://go.dev/play/p/KYGYJqNUBOI) +Example:[Run](https://go.dev/play/p/KYGYJqNUBOI) ```go package main @@ -549,7 +547,7 @@ func main() { func MapToSlice[T any, K comparable, V any](aMap map[K]V, iteratee func(K, V) T) []T ``` -Example:[Run](https://go.dev/play/p/dmX4Ix5V6Wl) +Example:[Run](https://go.dev/play/p/dmX4Ix5V6Wl) ```go package main @@ -579,7 +577,7 @@ func main() { func EncodeByte(data any) ([]byte, error) ``` -Example:[Run](https://go.dev/play/p/DVmM1G5JfuP) +Example:[Run](https://go.dev/play/p/DVmM1G5JfuP) ```go package main @@ -608,7 +606,7 @@ func main() { func DecodeByte(data []byte, target any) error ``` -Example:[Run](https://go.dev/play/p/zI6xsmuQRbn) +Example:[Run](https://go.dev/play/p/zI6xsmuQRbn) ```go package main @@ -644,7 +642,7 @@ func main() { func DeepClone[T any](src T) T ``` -Example:[Run](https://go.dev/play/p/j4DP5dquxnk) +Example:[Run](https://go.dev/play/p/j4DP5dquxnk) ```go package main @@ -708,7 +706,7 @@ func main() { func CopyProperties[T, U any](dst T, src U) (err error) ``` -Example:[Run](https://go.dev/play/p/oZujoB5Sgg5) +Example:[Run](https://go.dev/play/p/oZujoB5Sgg5) ```go package main @@ -787,7 +785,7 @@ func main() { func ToInterface(v reflect.Value) (value interface{}, ok bool) ``` -Example:[Run](https://go.dev/play/p/syqw0-WG7Xd) +Example:[Run](https://go.dev/play/p/syqw0-WG7Xd) ```go package main @@ -822,7 +820,7 @@ func main() { func Utf8ToGbk(bs []byte) ([]byte, error) ``` -Example:[Run](https://go.dev/play/p/9FlIaFLArIL) +Example:[Run](https://go.dev/play/p/9FlIaFLArIL) ```go package main @@ -856,7 +854,7 @@ func main() { func GbkToUtf8(bs []byte) ([]byte, error) ``` -Example:[Run](https://go.dev/play/p/OphmHCN_9u8) +Example:[Run](https://go.dev/play/p/OphmHCN_9u8) ```go package main diff --git a/docs/en/api/packages/cryptor.md b/docs/en/api/packages/cryptor.md index 083fe37..6833c2e 100644 --- a/docs/en/api/packages/cryptor.md +++ b/docs/en/api/packages/cryptor.md @@ -69,8 +69,6 @@ import (
- - ## Documentation ### AesEcbEncrypt @@ -82,7 +80,7 @@ import ( ```go func AesEcbEncrypt(data, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/zI6xsmuQRbn) +Example:[Run](https://go.dev/play/p/zI6xsmuQRbn) ```go package main @@ -115,7 +113,7 @@ func main() { ```go func AesEcbDecrypt(encrypted, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/zI6xsmuQRbn) +Example:[Run](https://go.dev/play/p/zI6xsmuQRbn) ```go package main @@ -148,7 +146,7 @@ func main() { ```go func AesCbcEncrypt(data, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/IOq_g8_lKZD) +Example:[Run](https://go.dev/play/p/IOq_g8_lKZD) ```go package main @@ -182,7 +180,7 @@ func main() { func AesCbcDecrypt(encrypted, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/IOq_g8_lKZD) +Example:[Run](https://go.dev/play/p/IOq_g8_lKZD) ```go package main @@ -216,7 +214,7 @@ func main() { func AesCtrCrypt(data, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/SpaZO0-5Nsp) +Example:[Run](https://go.dev/play/p/SpaZO0-5Nsp) ```go package main @@ -250,7 +248,7 @@ func main() { func AesCfbEncrypt(data, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/tfkF10B13kH) +Example:[Run](https://go.dev/play/p/tfkF10B13kH) ```go package main @@ -284,7 +282,7 @@ func main() { func AesCfbDecrypt(encrypted, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/tfkF10B13kH) +Example:[Run](https://go.dev/play/p/tfkF10B13kH) ```go package main @@ -318,7 +316,7 @@ func main() { func AesOfbEncrypt(data, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/VtHxtkUj-3F) +Example:[Run](https://go.dev/play/p/VtHxtkUj-3F) ```go package main @@ -351,7 +349,7 @@ func main() { func AesOfbDecrypt(encrypted, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/VtHxtkUj-3F) +Example:[Run](https://go.dev/play/p/VtHxtkUj-3F) ```go package main @@ -384,7 +382,7 @@ func main() { ```go func Base64StdEncode(s string) string ``` -Example:[Run](https://go.dev/play/p/VOaUyQUreoK) +Example:[Run](https://go.dev/play/p/VOaUyQUreoK) ```go package main @@ -412,7 +410,7 @@ func main() { func Base64StdDecode(s string) string ``` -Example:[Run](https://go.dev/play/p/RWQylnJVgIe) +Example:[Run](https://go.dev/play/p/RWQylnJVgIe) ```go package main @@ -441,7 +439,7 @@ func main() { func DesEcbEncrypt(data, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/8qivmPeZy4P) +Example:[Run](https://go.dev/play/p/8qivmPeZy4P) ```go package main @@ -475,7 +473,7 @@ func main() { func DesEcbDecrypt(encrypted, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/8qivmPeZy4P) +Example:[Run](https://go.dev/play/p/8qivmPeZy4P) ```go package main @@ -510,7 +508,7 @@ func main() { func DesCbcEncrypt(data, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/4cC4QvWfe3_1) +Example:[Run](https://go.dev/play/p/4cC4QvWfe3_1) ```go package main @@ -544,7 +542,7 @@ func main() { func DesCbcDecrypt(encrypted, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/4cC4QvWfe3_1) +Example:[Run](https://go.dev/play/p/4cC4QvWfe3_1) ```go package main @@ -577,7 +575,7 @@ func main() { func DesCtrCrypt(data, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/9-T6OjKpcdw) +Example:[Run](https://go.dev/play/p/9-T6OjKpcdw) ```go package main @@ -611,7 +609,7 @@ func main() { func DesCfbEncrypt(data, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/y-eNxcFBlxL) +Example:[Run](https://go.dev/play/p/y-eNxcFBlxL) ```go package main @@ -644,7 +642,7 @@ func main() { func DesCfbDecrypt(encrypted, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/y-eNxcFBlxL) +Example:[Run](https://go.dev/play/p/y-eNxcFBlxL) ```go package main @@ -677,7 +675,7 @@ func main() { func DesOfbEncrypt(data, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/74KmNadjN1J) +Example:[Run](https://go.dev/play/p/74KmNadjN1J) ```go package main @@ -710,7 +708,7 @@ func main() { func DesOfbDecrypt(encrypted, key []byte) []byte ``` -Example:[Run](https://go.dev/play/p/74KmNadjN1J) +Example:[Run](https://go.dev/play/p/74KmNadjN1J) ```go package main @@ -744,7 +742,7 @@ func main() { func HmacMd5(str, key string) string ``` -Example:[Run](https://go.dev/play/p/uef0q1fz53I) +Example:[Run](https://go.dev/play/p/uef0q1fz53I) ```go package main @@ -776,7 +774,7 @@ func main() { func HmacMd5WithBase64(str, key string) string ``` -Example:[Run](https://go.dev/play/p/UY0ng2AefFC) +Example:[Run](https://go.dev/play/p/UY0ng2AefFC) ```go package main @@ -808,7 +806,7 @@ func main() { func HmacSha1(str, key string) string ``` -Example:[Run](https://go.dev/play/p/1UI4oQ4WXKM) +Example:[Run](https://go.dev/play/p/1UI4oQ4WXKM) ```go package main @@ -840,7 +838,7 @@ func main() { func HmacSha1WithBase64(str, key string) string ``` -Example:[Run](https://go.dev/play/p/47JmmGrnF7B) +Example:[Run](https://go.dev/play/p/47JmmGrnF7B) ```go package main @@ -872,7 +870,7 @@ func main() { func HmacSha256(str, key string) string ``` -Example:[Run](https://go.dev/play/p/HhpwXxFhhC0) +Example:[Run](https://go.dev/play/p/HhpwXxFhhC0) ```go package main @@ -904,7 +902,7 @@ func main() { func HmacSha256WithBase64(str, key string) string ``` -Example:[Run](https://go.dev/play/p/EKbkUvPTLwO) +Example:[Run](https://go.dev/play/p/EKbkUvPTLwO) ```go package main @@ -936,7 +934,7 @@ func main() { func HmacSha512(str, key string) string ``` -Example:[Run](https://go.dev/play/p/59Od6m4A0Ud) +Example:[Run](https://go.dev/play/p/59Od6m4A0Ud) ```go package main @@ -968,7 +966,7 @@ func main() { func HmacSha512WithBase64(str, key string) string ``` -Example:[Run](https://go.dev/play/p/c6dSe3E2ydU) +Example:[Run](https://go.dev/play/p/c6dSe3E2ydU) ```go package main @@ -1001,7 +999,7 @@ func main() { func Md5String(s string) string ``` -Example:[Run](https://go.dev/play/p/1bLcVetbTOI) +Example:[Run](https://go.dev/play/p/1bLcVetbTOI) ```go package main @@ -1032,7 +1030,7 @@ func main() { func Md5StringWithBase64(s string) string ``` -Example:[Run](https://go.dev/play/p/Tcb-Z7LN2ax) +Example:[Run](https://go.dev/play/p/Tcb-Z7LN2ax) ```go package main @@ -1061,7 +1059,7 @@ func main() { func Md5Byte(data []byte) string ``` -Example:[Run](https://go.dev/play/p/suraalH8lyC) +Example:[Run](https://go.dev/play/p/suraalH8lyC) ```go package main @@ -1090,7 +1088,7 @@ func main() { func Md5ByteWithBase64(data []byte) string ``` -Example:[Run](https://go.dev/play/p/Lx4gH7Vdr5_y) +Example:[Run](https://go.dev/play/p/Lx4gH7Vdr5_y) ```go package main @@ -1145,7 +1143,7 @@ func main() { func Sha1(str string) string ``` -Example:[Run](https://go.dev/play/p/_m_uoD1deMT) +Example:[Run](https://go.dev/play/p/_m_uoD1deMT) ```go package main @@ -1176,7 +1174,7 @@ func main() { func Sha1WithBase64(str string) string ``` -Example:[Run](https://go.dev/play/p/fSyx-Gl2l2-) +Example:[Run](https://go.dev/play/p/fSyx-Gl2l2-) ```go package main @@ -1205,7 +1203,7 @@ func main() { func Sha256(str string) string ``` -Example:[Run](https://go.dev/play/p/tU9tfBMIAr1) +Example:[Run](https://go.dev/play/p/tU9tfBMIAr1) ```go package main @@ -1236,7 +1234,7 @@ func main() { func Sha256WithBase64(str string) string ``` -Example:[Run](https://go.dev/play/p/85IXJHIal1k) +Example:[Run](https://go.dev/play/p/85IXJHIal1k) ```go package main @@ -1265,7 +1263,7 @@ func main() { func Sha512(str string) string ``` -Example:[Run](https://go.dev/play/p/3WsvLYZxsHa) +Example:[Run](https://go.dev/play/p/3WsvLYZxsHa) ```go package main @@ -1296,7 +1294,7 @@ func main() { func Sha512WithBase64(str string) string ``` -Example:[Run](https://go.dev/play/p/q_fY2rA-k5I) +Example:[Run](https://go.dev/play/p/q_fY2rA-k5I) ```go package main @@ -1325,7 +1323,7 @@ func main() { func GenerateRsaKey(keySize int, priKeyFile, pubKeyFile string) error ``` -Example:[Run](https://go.dev/play/p/zutRHrDqs0X) +Example:[Run](https://go.dev/play/p/zutRHrDqs0X) ```go package main @@ -1353,7 +1351,7 @@ func main() { func RsaEncrypt(data []byte, pubKeyFileName string) []byte ``` -Example:[Run](https://go.dev/play/p/uef0q1fz53I) +Example:[Run](https://go.dev/play/p/uef0q1fz53I) ```go package main @@ -1391,7 +1389,7 @@ func main() { func RsaDecrypt(data []byte, privateKeyFileName string) []byte ``` -Example:[Run](https://go.dev/play/p/uef0q1fz53I) +Example:[Run](https://go.dev/play/p/uef0q1fz53I) ```go package main diff --git a/docs/en/api/packages/datetime.md b/docs/en/api/packages/datetime.md index 12143bc..6fc31ef 100644 --- a/docs/en/api/packages/datetime.md +++ b/docs/en/api/packages/datetime.md @@ -68,8 +68,6 @@ import (
- - ## Documentation ## Note: @@ -109,7 +107,7 @@ import ( func AddDay(t time.Time, day int64) time.Time ``` -Example:[Run](https://go.dev/play/p/dIGbs_uTdFa) +Example:[Run](https://go.dev/play/p/dIGbs_uTdFa) ```go package main @@ -148,7 +146,7 @@ func main() { func AddHour(t time.Time, hour int64) time.Time ``` -Example:[Run](https://go.dev/play/p/rcMjd7OCsi5) +Example:[Run](https://go.dev/play/p/rcMjd7OCsi5) ```go package main @@ -187,7 +185,7 @@ func main() { func AddMinute(t time.Time, minute int64) time.Time ``` -Example:[Run](https://go.dev/play/p/nT1heB1KUUK) +Example:[Run](https://go.dev/play/p/nT1heB1KUUK) ```go package main @@ -226,7 +224,7 @@ func main() { func AddYear(t time.Time, year int64) time.Time ``` -Example:[Run](https://go.dev/play/p/MqW2ujnBx10) +Example:[Run](https://go.dev/play/p/MqW2ujnBx10) ```go package main @@ -265,7 +263,7 @@ func main() { func BeginOfMinute(t time.Time) time.Time ``` -Example:[Run](https://go.dev/play/p/ieOLVJ9CiFT) +Example:[Run](https://go.dev/play/p/ieOLVJ9CiFT) ```go package main @@ -297,7 +295,7 @@ func main() { func BeginOfHour(t time.Time) time.Time ``` -Example:[Run](https://go.dev/play/p/GhdGFnDWpYs) +Example:[Run](https://go.dev/play/p/GhdGFnDWpYs) ```go package main @@ -329,7 +327,7 @@ func main() { func BeginOfDay(t time.Time) time.Time ``` -Example:[Run](https://go.dev/play/p/94m_UT6cWs9) +Example:[Run](https://go.dev/play/p/94m_UT6cWs9) ```go package main @@ -361,7 +359,7 @@ func main() { func BeginOfWeek(t time.Time, beginFrom ...time.Weekday) time.Time ``` -Example:[Run](https://go.dev/play/p/ynjoJPz7VNV) +Example:[Run](https://go.dev/play/p/ynjoJPz7VNV) ```go package main @@ -393,7 +391,7 @@ func main() { func BeginOfMonth(t time.Time) time.Time ``` -Example:[Run](https://go.dev/play/p/bWXVFsmmzwL) +Example:[Run](https://go.dev/play/p/bWXVFsmmzwL) ```go package main @@ -425,7 +423,7 @@ func main() { func BeginOfYear(t time.Time) time.Time ``` -Example:[Run](https://go.dev/play/p/i326DSwLnV8) +Example:[Run](https://go.dev/play/p/i326DSwLnV8) ```go package main @@ -457,7 +455,7 @@ func main() { func EndOfMinute(t time.Time) time.Time ``` -Example:[Run](https://go.dev/play/p/yrL5wGzPj4z) +Example:[Run](https://go.dev/play/p/yrL5wGzPj4z) ```go package main @@ -489,7 +487,7 @@ func main() { func EndOfHour(t time.Time) time.Time ``` -Example:[Run](https://go.dev/play/p/6ce3j_6cVqN) +Example:[Run](https://go.dev/play/p/6ce3j_6cVqN) ```go package main @@ -521,7 +519,7 @@ func main() { func EndOfDay(t time.Time) time.Time ``` -Example:[Run](https://go.dev/play/p/eMBOvmq5Ih1) +Example:[Run](https://go.dev/play/p/eMBOvmq5Ih1) ```go package main @@ -553,7 +551,7 @@ func main() { func EndOfWeek(t time.Time, endWith ...time.Weekday) time.Time ``` -Example:[Run](https://go.dev/play/p/i08qKXD9flf) +Example:[Run](https://go.dev/play/p/i08qKXD9flf) ```go package main @@ -585,7 +583,7 @@ func main() { func EndOfMonth(t time.Time) time.Time ``` -Example:[Run](https://go.dev/play/p/_GWh10B3Nqi) +Example:[Run](https://go.dev/play/p/_GWh10B3Nqi) ```go package main @@ -617,7 +615,7 @@ func main() { func EndOfYear(t time.Time) time.Time ``` -Example:[Run](https://go.dev/play/p/G01cKlMCvNm) +Example:[Run](https://go.dev/play/p/G01cKlMCvNm) ```go package main @@ -649,7 +647,7 @@ func main() { func GetNowDate() string ``` -Example:[Run](https://go.dev/play/p/PvfkPpcpBBf) +Example:[Run](https://go.dev/play/p/PvfkPpcpBBf) ```go package main @@ -678,7 +676,7 @@ func main() { func GetNowTime() string ``` -Example:[Run](https://go.dev/play/p/l7BNxCkTmJS) +Example:[Run](https://go.dev/play/p/l7BNxCkTmJS) ```go package main @@ -707,7 +705,7 @@ func main() { func GetNowDateTime() string ``` -Example:[Run](https://go.dev/play/p/pI4AqngD0al) +Example:[Run](https://go.dev/play/p/pI4AqngD0al) ```go package main @@ -736,7 +734,7 @@ func main() { func GetTodayStartTime() string ``` -Example:[Run](https://go.dev/play/p/84siyYF7t99) +Example:[Run](https://go.dev/play/p/84siyYF7t99) ```go package main @@ -765,7 +763,7 @@ func main() { func GetTodayEndTime() string ``` -Example:[Run](https://go.dev/play/p/jjrLnfoqgn3) +Example:[Run](https://go.dev/play/p/jjrLnfoqgn3) ```go package main @@ -794,7 +792,7 @@ func main() { func GetZeroHourTimestamp() int64 ``` -Example:[Run](https://go.dev/play/p/QmL2oIaGE3q) +Example:[Run](https://go.dev/play/p/QmL2oIaGE3q) ```go package main @@ -823,7 +821,7 @@ func main() { func GetNightTimestamp() int64 ``` -Example:[Run](https://go.dev/play/p/UolysR3MYP1) +Example:[Run](https://go.dev/play/p/UolysR3MYP1) ```go package main @@ -852,7 +850,7 @@ func main() { func FormatTimeToStr(t time.Time, format string, timezone ...string) string ``` -Example:[Run](https://go.dev/play/p/_Ia7M8H_OvE) +Example:[Run](https://go.dev/play/p/_Ia7M8H_OvE) ```go package main @@ -891,7 +889,7 @@ func main() { func FormatStrToTime(str, format string, timezone ...string) (time.Time, error) ``` -Example:[Run](https://go.dev/play/p/1h9FwdU8ql4) +Example:[Run](https://go.dev/play/p/1h9FwdU8ql4) ```go package main @@ -930,7 +928,7 @@ type theTime struct { func NewUnixNow() *theTime ``` -Example:[Run](https://go.dev/play/p/U4PPx-9D0oz) +Example:[Run](https://go.dev/play/p/U4PPx-9D0oz) ```go package main @@ -962,7 +960,7 @@ type theTime struct { func NewUnix(unix int64) *theTime ``` -Example:[Run](https://go.dev/play/p/psoSuh_kLRt) +Example:[Run](https://go.dev/play/p/psoSuh_kLRt) ```go package main @@ -994,7 +992,7 @@ type theTime struct { func NewFormat(t string) (*theTime, error) ``` -Example:[Run](https://go.dev/play/p/VkW08ZOaXPZ) +Example:[Run](https://go.dev/play/p/VkW08ZOaXPZ) ```go package main @@ -1026,7 +1024,7 @@ type theTime struct { func NewISO8601(iso8601 string) (*theTime, error) ``` -Example:[Run](https://go.dev/play/p/mkhOHQkdeA2) +Example:[Run](https://go.dev/play/p/mkhOHQkdeA2) ```go package main @@ -1055,7 +1053,7 @@ func main() { func (t *theTime) ToUnix() int64 ``` -Example:[Run](https://go.dev/play/p/_LUiwAdocjy) +Example:[Run](https://go.dev/play/p/_LUiwAdocjy) ```go package main @@ -1084,7 +1082,7 @@ func main() { func (t *theTime) ToFormat() string ``` -Example:[Run](https://go.dev/play/p/VkW08ZOaXPZ) +Example:[Run](https://go.dev/play/p/VkW08ZOaXPZ) ```go package main @@ -1113,7 +1111,7 @@ func main() { func (t *theTime) ToFormatForTpl(tpl string) string ``` -Example:[Run](https://go.dev/play/p/nyXxXcQJ8L5) +Example:[Run](https://go.dev/play/p/nyXxXcQJ8L5) ```go package main @@ -1143,7 +1141,7 @@ func main() { func (t *theTime) ToIso8601() string ``` -Example:[Run](https://go.dev/play/p/mkhOHQkdeA2) +Example:[Run](https://go.dev/play/p/mkhOHQkdeA2) ```go package main @@ -1173,7 +1171,7 @@ func main() { func IsLeapYear(year int) bool ``` -Example:[Run](https://go.dev/play/p/xS1eS2ejGew) +Example:[Run](https://go.dev/play/p/xS1eS2ejGew) ```go package main @@ -1206,7 +1204,7 @@ func main() { func BetweenSeconds(t1 time.Time, t2 time.Time) int64 ``` -Example:[Run](https://go.dev/play/p/n3YDRyfyXJu) +Example:[Run](https://go.dev/play/p/n3YDRyfyXJu) ```go package main @@ -1243,7 +1241,7 @@ func main() { func DayOfYear(t time.Time) int ``` -Example:[Run](https://go.dev/play/p/0hjqhTwFNlH) +Example:[Run](https://go.dev/play/p/0hjqhTwFNlH) ```go package main @@ -1284,7 +1282,7 @@ func main() { func IsWeekend(t time.Time) bool ``` -Example:[Run](https://go.dev/play/p/cupRM5aZOIY) +Example:[Run](https://go.dev/play/p/cupRM5aZOIY) ```go package main @@ -1324,7 +1322,7 @@ func main() { func NowDateOrTime(format string, timezone ...string) string ``` -Example:[Run](https://go.dev/play/p/EZ-begEjtT0) +Example:[Run](https://go.dev/play/p/EZ-begEjtT0) ```go package main @@ -1358,7 +1356,7 @@ func main() { func Timestamp(timezone ...string) int64 ``` -Example:[Run](https://go.dev/play/p/iU5b7Vvjx6x) +Example:[Run](https://go.dev/play/p/iU5b7Vvjx6x) ```go package main @@ -1378,7 +1376,6 @@ func main() { } ``` - ### TimestampMilli

Return current mill second timestamp.

@@ -1389,7 +1386,7 @@ func main() { func TimestampMilli(timezone ...string) int64 ``` -Example:[Run](https://go.dev/play/p/4gvEusOTu1T) +Example:[Run](https://go.dev/play/p/4gvEusOTu1T) ```go package main @@ -1419,7 +1416,7 @@ func main() { func TimestampMicro(timezone ...string) int64 ``` -Example:[Run](https://go.dev/play/p/2maANglKHQE) +Example:[Run](https://go.dev/play/p/2maANglKHQE) ```go package main @@ -1449,7 +1446,7 @@ func main() { func TimestampNano(timezone ...string) int64 ``` -Example:[Run](https://go.dev/play/p/A9Oq_COrcCF) +Example:[Run](https://go.dev/play/p/A9Oq_COrcCF) ```go package main diff --git a/docs/en/api/packages/fileutil.md b/docs/en/api/packages/fileutil.md index e995d16..a4d4fd4 100644 --- a/docs/en/api/packages/fileutil.md +++ b/docs/en/api/packages/fileutil.md @@ -50,8 +50,6 @@ import (
- - ## Documentation ### ClearFile @@ -64,7 +62,7 @@ import ( func ClearFile(path string) error ``` -Example:[Run](https://go.dev/play/p/NRZ0ZT-G94H) +Example:[Run](https://go.dev/play/p/NRZ0ZT-G94H) ```go package main @@ -92,7 +90,7 @@ func main() { func CreateFile(path string) bool ``` -Example:[Run](https://go.dev/play/p/lDt8PEsTNKI) +Example:[Run](https://go.dev/play/p/lDt8PEsTNKI) ```go package main @@ -118,7 +116,7 @@ func main() { func CreateDir(absPath string) error ``` -Example:[Run](https://go.dev/play/p/qUuCe1OGQnM) +Example:[Run](https://go.dev/play/p/qUuCe1OGQnM) ```go package main @@ -144,7 +142,7 @@ func main() { func CopyFile(srcPath string, dstPath string) error ``` -Example:[Run](https://go.dev/play/p/Jg9AMJMLrJi) +Example:[Run](https://go.dev/play/p/Jg9AMJMLrJi) ```go package main @@ -172,7 +170,7 @@ func main() { func CurrentPath() string ``` -Example:[Run](https://go.dev/play/p/s74a9iBGcSw) +Example:[Run](https://go.dev/play/p/s74a9iBGcSw) ```go package main @@ -198,7 +196,7 @@ func main() { func FileMode(path string) (fs.FileMode, error) ``` -Example:[Run](https://go.dev/play/p/2l2hI42fA3p) +Example:[Run](https://go.dev/play/p/2l2hI42fA3p) ```go package main @@ -227,7 +225,7 @@ func main() { func MiMeType(file any) string ``` -Example:[Run](https://go.dev/play/p/bd5sevSUZNu) +Example:[Run](https://go.dev/play/p/bd5sevSUZNu) ```go package main @@ -258,7 +256,7 @@ func main() { func IsExist(path string) bool ``` -Example:[Run](https://go.dev/play/p/nKKXt8ZQbmh) +Example:[Run](https://go.dev/play/p/nKKXt8ZQbmh) ```go package main @@ -285,7 +283,7 @@ func main() { func IsLink(path string) bool ``` -Example:[Run](https://go.dev/play/p/TL-b-Kzvf44) +Example:[Run](https://go.dev/play/p/TL-b-Kzvf44) ```go package main @@ -311,7 +309,7 @@ func main() { func IsDir(path string) bool ``` -Example:[Run](https://go.dev/play/p/WkVwEKqtOWk) +Example:[Run](https://go.dev/play/p/WkVwEKqtOWk) ```go package main @@ -340,7 +338,7 @@ func main() { func ListFileNames(path string) ([]string, error) ``` -Example:[Run](https://go.dev/play/p/Tjd7Y07rejl) +Example:[Run](https://go.dev/play/p/Tjd7Y07rejl) ```go package main @@ -366,7 +364,7 @@ func main() { func RemoveFile(path string) error ``` -Example:[Run](https://go.dev/play/p/P2y0XW8a1SH) +Example:[Run](https://go.dev/play/p/P2y0XW8a1SH) ```go package main @@ -394,7 +392,7 @@ func main() { func ReadFileToString(path string) (string, error) ``` -Example:[Run](https://go.dev/play/p/cmfwp_5SQTp) +Example:[Run](https://go.dev/play/p/cmfwp_5SQTp) ```go package main @@ -427,7 +425,7 @@ func main() { func ReadFileByLine(path string)([]string, error) ``` -Example:[Run](https://go.dev/play/p/svJP_7ZrBrD) +Example:[Run](https://go.dev/play/p/svJP_7ZrBrD) ```go package main @@ -461,7 +459,7 @@ func main() { func Zip(fpath string, destPath string) error ``` -Example:[Run](https://go.dev/play/p/j-3sWBp8ik_P) +Example:[Run](https://go.dev/play/p/j-3sWBp8ik_P) ```go package main @@ -489,7 +487,7 @@ func main() { func ZipAppendEntry(fpath string, destPath string) error ``` -Example:[Run](https://go.dev/play/p/cxvaT8TRNQp) +Example:[Run](https://go.dev/play/p/cxvaT8TRNQp) ```go package main @@ -517,7 +515,7 @@ func main() { func UnZip(zipFile string, destPath string) error ``` -Example:[Run](https://go.dev/play/p/g0w34kS7B8m) +Example:[Run](https://go.dev/play/p/g0w34kS7B8m) ```go package main @@ -545,7 +543,7 @@ func main() { func IsZipFile(filepath string) bool ``` -Example:[Run](https://go.dev/play/p/9M0g2j_uF_e) +Example:[Run](https://go.dev/play/p/9M0g2j_uF_e) ```go package main @@ -571,7 +569,7 @@ func main() { func FileSize(path string) (int64, error) ``` -Example:[Run](https://go.dev/play/p/H9Z05uD-Jjc) +Example:[Run](https://go.dev/play/p/H9Z05uD-Jjc) ```go package main @@ -603,7 +601,7 @@ func main() { func MTime(filepath string) (int64, error) ``` -Example:[Run](https://go.dev/play/p/s_Tl7lZoAaY) +Example:[Run](https://go.dev/play/p/s_Tl7lZoAaY) ```go package main @@ -635,7 +633,7 @@ func main() { func Sha(filepath string, shaType ...int) (string, error) ``` -Example:[Run](https://go.dev/play/p/VfEEcO2MJYf) +Example:[Run](https://go.dev/play/p/VfEEcO2MJYf) ```go package main @@ -673,7 +671,7 @@ func main() { func ReadCsvFile(filepath string) ([][]string, error) ``` -Example:[Run](https://go.dev/play/p/OExTkhGEd3_u) +Example:[Run](https://go.dev/play/p/OExTkhGEd3_u) ```go package main @@ -705,7 +703,7 @@ func main() { func WriteCsvFile(filepath string, records [][]string, append bool) error ``` -Example:[Run](https://go.dev/play/p/dAXm58Q5U1o) +Example:[Run](https://go.dev/play/p/dAXm58Q5U1o) ```go package main @@ -754,7 +752,7 @@ func main() { func WriteBytesToFile(filepath string, content []byte) error ``` -Example:[Run](https://go.dev/play/p/s7QlDxMj3P8) +Example:[Run](https://go.dev/play/p/s7QlDxMj3P8) ```go package main @@ -803,7 +801,7 @@ func main() { func WriteStringToFile(filepath string, content string, append bool) error ``` -Example:[Run](https://go.dev/play/p/GhLS6d8lH_g) +Example:[Run](https://go.dev/play/p/GhLS6d8lH_g) ```go package main diff --git a/docs/en/api/packages/formatter.md b/docs/en/api/packages/formatter.md index 783e57c..66726ad 100644 --- a/docs/en/api/packages/formatter.md +++ b/docs/en/api/packages/formatter.md @@ -33,8 +33,6 @@ import (
- - ## Documentation ### Comma @@ -47,7 +45,7 @@ import ( func Comma[T constraints.Float | constraints.Integer | string](value T, symbol string) string ``` -Example:[Run](https://go.dev/play/p/eRD5k2vzUVX) +Example:[Run](https://go.dev/play/p/eRD5k2vzUVX) ```go package main @@ -83,7 +81,7 @@ func main() { func Pretty(v any) (string, error) ``` -Example:[Run](https://go.dev/play/p/YsciGj3FH2x) +Example:[Run](https://go.dev/play/p/YsciGj3FH2x) ```go package main @@ -122,7 +120,7 @@ func main() { func PrettyToWriter(v any, out io.Writer) error ``` -Example:[Run](https://go.dev/play/p/LPLZ3lDi5ma) +Example:[Run](https://go.dev/play/p/LPLZ3lDi5ma) ```go package main @@ -165,7 +163,7 @@ func main() { func DecimalBytes(size float64, precision ...int) string ``` -Example:[Run](https://go.dev/play/p/FPXs1suwRcs) +Example:[Run](https://go.dev/play/p/FPXs1suwRcs) ```go package main @@ -204,7 +202,7 @@ func main() { func BinaryBytes(size float64, precision ...int) string ``` -Example:[Run](https://go.dev/play/p/G9oHHMCAZxP) +Example:[Run](https://go.dev/play/p/G9oHHMCAZxP) ```go package main @@ -243,7 +241,7 @@ func main() { func ParseDecimalBytes(size string) (uint64, error) ``` -Example:[Run](https://go.dev/play/p/Am98ybWjvjj) +Example:[Run](https://go.dev/play/p/Am98ybWjvjj) ```go package main @@ -282,7 +280,7 @@ func main() { func ParseBinaryBytes(size string) (uint64, error) ``` -Example:[Run](https://go.dev/play/p/69v1tTT62x8) +Example:[Run](https://go.dev/play/p/69v1tTT62x8) ```go package main diff --git a/docs/en/api/packages/function.md b/docs/en/api/packages/function.md index 5565890..c1dd70b 100644 --- a/docs/en/api/packages/function.md +++ b/docs/en/api/packages/function.md @@ -35,7 +35,6 @@ import (
- ## Documentation ### After @@ -48,7 +47,7 @@ import ( func After(n int, fn any) func(args ...any) []reflect.Value ``` -Example:[Run](https://go.dev/play/p/eRD5k2vzUVX) +Example:[Run](https://go.dev/play/p/eRD5k2vzUVX) ```go package main @@ -81,7 +80,7 @@ func main() { func Before(n int, fn any) func(args ...any) []reflect.Value ``` -Example:[Run](https://go.dev/play/p/0HqUDIFZ3IL) +Example:[Run](https://go.dev/play/p/0HqUDIFZ3IL) ```go package main @@ -118,7 +117,7 @@ type CurryFn[T any] func(...T) T func (cf CurryFn[T]) New(val T) func(...T) T ``` -Example:[Run](https://go.dev/play/p/5HopfDwANKX) +Example:[Run](https://go.dev/play/p/5HopfDwANKX) ```go package main @@ -157,7 +156,7 @@ func main() { func Compose[T any](fnList ...func(...T) T) func(...T) T ``` -Example:[Run](https://go.dev/play/p/KKfugD4PKYF) +Example:[Run](https://go.dev/play/p/KKfugD4PKYF) ```go package main @@ -195,7 +194,7 @@ func main() { func Debounced(fn func(), duration time.Duration) func() ``` -Example:[Run](https://go.dev/play/p/absuEGB_GN7) +Example:[Run](https://go.dev/play/p/absuEGB_GN7) ```go package main @@ -245,7 +244,7 @@ func main() { func Delay(delay time.Duration, fn any, args ...any) ``` -Example:[Run](https://go.dev/play/p/Ivtc2ZE-Tye) +Example:[Run](https://go.dev/play/p/Ivtc2ZE-Tye) ```go package main @@ -277,7 +276,7 @@ func main() { func Schedule(d time.Duration, fn any, args ...any) chan bool ``` -Example:[Run](https://go.dev/play/p/hbON-Xeyn5N) +Example:[Run](https://go.dev/play/p/hbON-Xeyn5N) ```go package main @@ -317,7 +316,7 @@ the functions one by one.

func Pipeline[T any](funcs ...func(T) T) func(T) T ``` -Example:[Run](https://go.dev/play/p/mPdUVvj6HD6) +Example:[Run](https://go.dev/play/p/mPdUVvj6HD6) ```go package main @@ -368,7 +367,7 @@ func (w *Watcher) Reset() //reset the watcher func (w *Watcher) GetElapsedTime() time.Duration //get the elapsed time of function execution ``` -Example:[Run](https://go.dev/play/p/l2yrOpCLd1I) +Example:[Run](https://go.dev/play/p/l2yrOpCLd1I) ```go package main diff --git a/docs/en/api/packages/maputil.md b/docs/en/api/packages/maputil.md index af03f0e..6e12a07 100644 --- a/docs/en/api/packages/maputil.md +++ b/docs/en/api/packages/maputil.md @@ -55,8 +55,6 @@ import (
- - ## Documentation ### MapTo @@ -69,7 +67,7 @@ import ( func MapTo(src any, dst any) error ``` -Example:[Run](https://go.dev/play/p/4K7KBEPgS5M) +Example:[Run](https://go.dev/play/p/4K7KBEPgS5M) ```go package main @@ -126,7 +124,7 @@ func main() { func ForEach[K comparable, V any](m map[K]V, iteratee func(key K, value V)) ``` -Example:[Run](https://go.dev/play/p/OaThj6iNVXK) +Example:[Run](https://go.dev/play/p/OaThj6iNVXK) ```go package main @@ -167,7 +165,7 @@ func main() { func Filter[K comparable, V any](m map[K]V, predicate func(key K, value V) bool) map[K]V ``` -Example:[Run](https://go.dev/play/p/fSvF3wxuNG7) +Example:[Run](https://go.dev/play/p/fSvF3wxuNG7) ```go package main @@ -212,7 +210,7 @@ func main() { func FilterByKeys[K comparable, V any](m map[K]V, keys []K) map[K]V ``` -Example:[Run](https://go.dev/play/p/7ov6BJHbVqh) +Example:[Run](https://go.dev/play/p/7ov6BJHbVqh) ```go package main @@ -250,7 +248,7 @@ func main() { func FilterByValues[K comparable, V comparable](m map[K]V, values []V) map[K]V ``` -Example:[Run](https://go.dev/play/p/P3-9MdcXegR) +Example:[Run](https://go.dev/play/p/P3-9MdcXegR) ```go package main @@ -288,7 +286,7 @@ func main() { func OmitBy[K comparable, V any](m map[K]V, predicate func(key K, value V) bool) map[K]V ``` -Example:[Run](https://go.dev/play/p/YJM4Hj5hNwm) +Example:[Run](https://go.dev/play/p/YJM4Hj5hNwm) ```go package main @@ -329,7 +327,7 @@ func main() { func OmitByKeys[K comparable, V any](m map[K]V, keys []K) map[K]V ``` -Example:[Run](https://go.dev/play/p/jXGrWDBfSRp) +Example:[Run](https://go.dev/play/p/jXGrWDBfSRp) ```go package main @@ -367,7 +365,7 @@ func main() { func OmitByValues[K comparable, V comparable](m map[K]V, values []V) map[K]V ``` -Example:[Run](https://go.dev/play/p/XB7Y10uw20_U) +Example:[Run](https://go.dev/play/p/XB7Y10uw20_U) ```go package main @@ -405,7 +403,7 @@ func main() { func Intersect[K comparable, V any](maps ...map[K]V) map[K]V ``` -Example:[Run](https://go.dev/play/p/Zld0oj3sjcC) +Example:[Run](https://go.dev/play/p/Zld0oj3sjcC) ```go package main @@ -460,7 +458,7 @@ func main() { func Keys[K comparable, V any](m map[K]V) []K ``` -Example:[Run](https://go.dev/play/p/xNB5bTb97Wd) +Example:[Run](https://go.dev/play/p/xNB5bTb97Wd) ```go package main @@ -500,7 +498,7 @@ func main() { func Merge[K comparable, V any](maps ...map[K]V) map[K]V ``` -Example:[Run](https://go.dev/play/p/H95LENF1uB-) +Example:[Run](https://go.dev/play/p/H95LENF1uB-) ```go package main @@ -539,7 +537,7 @@ func main() { func Minus[K comparable, V any](mapA, mapB map[K]V) map[K]V ``` -Example:[Run](https://go.dev/play/p/3u5U9K7YZ9m) +Example:[Run](https://go.dev/play/p/3u5U9K7YZ9m) ```go package main @@ -581,7 +579,7 @@ func main() { func Values[K comparable, V any](m map[K]V) []V ``` -Example:[Run](https://go.dev/play/p/CBKdUc5FTW6) +Example:[Run](https://go.dev/play/p/CBKdUc5FTW6) ```go package main @@ -621,7 +619,7 @@ func main() { func KeysBy[K comparable, V any, T any](m map[K]V, mapper func(item K) T) []T ``` -Example:[Run](https://go.dev/play/p/hI371iB8Up8) +Example:[Run](https://go.dev/play/p/hI371iB8Up8) ```go package main @@ -662,7 +660,7 @@ func main() { func ValuesBy[K comparable, V any, T any](m map[K]V, mapper func(item V) T) []T ``` -Example:[Run](https://go.dev/play/p/sg9-oRidh8f) +Example:[Run](https://go.dev/play/p/sg9-oRidh8f) ```go package main @@ -711,7 +709,7 @@ func main() { func MapKeys[K comparable, V any, T comparable](m map[K]V, iteratee func(key K, value V) T) map[T]V ``` -Example:[Run](https://go.dev/play/p/8scDxWeBDKd) +Example:[Run](https://go.dev/play/p/8scDxWeBDKd) ```go package main @@ -750,7 +748,7 @@ func main() { func MapValues[K comparable, V any, T any](m map[K]V, iteratee func(key K, value V) T) map[K]T ``` -Example:[Run](https://go.dev/play/p/g92aY3fc7Iw) +Example:[Run](https://go.dev/play/p/g92aY3fc7Iw) ```go package main @@ -793,7 +791,7 @@ type Entry[K comparable, V any] struct { func Entries[K comparable, V any](m map[K]V) []Entry[K, V] ``` -Example:[Run](https://go.dev/play/p/Ltb11LNcElY) +Example:[Run](https://go.dev/play/p/Ltb11LNcElY) ```go package main @@ -838,7 +836,7 @@ type Entry[K comparable, V any] struct { func FromEntries[K comparable, V any](entries []Entry[K, V]) map[K]V ``` -Example:[Run](https://go.dev/play/p/fTdu4sCNjQO) +Example:[Run](https://go.dev/play/p/fTdu4sCNjQO) ```go package main @@ -872,7 +870,7 @@ func main() { func Transform[K1 comparable, V1 any, K2 comparable, V2 any](m map[K1]V1, iteratee func(key K1, value V1) (K2, V2)) map[K2]V2 ``` -Example:[Run](https://go.dev/play/p/P6ovfToM3zj) +Example:[Run](https://go.dev/play/p/P6ovfToM3zj) ```go package main @@ -911,7 +909,7 @@ func main() { func IsDisjoint[K comparable, V any](mapA, mapB map[K]V) bool ``` -Example:[Run](https://go.dev/play/p/N9qgYg_Ho6f) +Example:[Run](https://go.dev/play/p/N9qgYg_Ho6f) ```go package main @@ -966,7 +964,7 @@ if haskey { func HasKey[K comparable, V any](m map[K]V, key K) bool ``` -Example:[Run](https://go.dev/play/p/isZZHOsDhFc) +Example:[Run](https://go.dev/play/p/isZZHOsDhFc) ```go package main @@ -1005,7 +1003,7 @@ func main() { func NewConcurrentMap[K comparable, V any](shardCount int) *ConcurrentMap[K, V] ``` -Example:[Run](https://go.dev/play/p/3PenTPETJT0) +Example:[Run](https://go.dev/play/p/3PenTPETJT0) ```go package main @@ -1031,7 +1029,7 @@ func main() { func (cm *ConcurrentMap[K, V]) Set(key K, value V) ``` -Example:[Run](https://go.dev/play/p/3PenTPETJT0) +Example:[Run](https://go.dev/play/p/3PenTPETJT0) ```go package main @@ -1086,7 +1084,7 @@ func main() { func (cm *ConcurrentMap[K, V]) Get(key K) (V, bool) ``` -Example:[Run](https://go.dev/play/p/3PenTPETJT0) +Example:[Run](https://go.dev/play/p/3PenTPETJT0) ```go package main @@ -1141,7 +1139,7 @@ func main() { func (cm *ConcurrentMap[K, V]) GetOrSet(key K, value V) (actual V, ok bool) ``` -Example:[Run](https://go.dev/play/p/aDcDApOK01a) +Example:[Run](https://go.dev/play/p/aDcDApOK01a) ```go package main @@ -1185,7 +1183,7 @@ func main() { func (cm *ConcurrentMap[K, V]) Delete(key K) ``` -Example:[Run](https://go.dev/play/p/uTIJZYhpVMS) +Example:[Run](https://go.dev/play/p/uTIJZYhpVMS) ```go package main @@ -1232,7 +1230,7 @@ func main() { func (cm *ConcurrentMap[K, V]) GetAndDelete(key K) (actual V, ok bool) ``` -Example:[Run](https://go.dev/play/p/ZyxeIXSZUiM) +Example:[Run](https://go.dev/play/p/ZyxeIXSZUiM) ```go package main @@ -1284,7 +1282,7 @@ func main() { func (cm *ConcurrentMap[K, V]) Has(key K) bool ``` -Example:[Run](https://go.dev/play/p/C8L4ul9TVwf) +Example:[Run](https://go.dev/play/p/C8L4ul9TVwf) ```go package main @@ -1331,7 +1329,7 @@ func main() { func (cm *ConcurrentMap[K, V]) Range(iterator func(key K, value V) bool) ``` -Example:[Run](https://go.dev/play/p/iqcy7P8P0Pr) +Example:[Run](https://go.dev/play/p/iqcy7P8P0Pr) ```go package main diff --git a/docs/en/api/packages/mathutil.md b/docs/en/api/packages/mathutil.md index 556c131..71146f0 100644 --- a/docs/en/api/packages/mathutil.md +++ b/docs/en/api/packages/mathutil.md @@ -50,8 +50,6 @@ import (
- - ## Documentation ### Average @@ -64,7 +62,7 @@ import ( func Average[T constraints.Integer | constraints.Float](numbers ...T) T ``` -Example:[Run](https://go.dev/play/p/Vv7LBwER-pz) +Example:[Run](https://go.dev/play/p/Vv7LBwER-pz) ```go package main @@ -99,7 +97,7 @@ func main() { func Exponent(x, n int64) int64 ``` -Example:[Run](https://go.dev/play/p/uF3HGNPk8wr) +Example:[Run](https://go.dev/play/p/uF3HGNPk8wr) ```go package main @@ -135,7 +133,7 @@ func main() { func Fibonacci(first, second, n int) int ``` -Example:[Run](https://go.dev/play/p/IscseUNMuUc) +Example:[Run](https://go.dev/play/p/IscseUNMuUc) ```go package main @@ -171,7 +169,7 @@ func main() { func Factorial(x uint) uint ``` -Example:[Run](https://go.dev/play/p/tt6LdOK67Nx) +Example:[Run](https://go.dev/play/p/tt6LdOK67Nx) ```go package main @@ -207,7 +205,7 @@ func main() { func Max[T constraints.Integer | constraints.Float](numbers ...T) T ``` -Example:[Run](https://go.dev/play/p/cN8DHI0rTkH) +Example:[Run](https://go.dev/play/p/cN8DHI0rTkH) ```go package main @@ -240,7 +238,7 @@ func main() { func MaxBy[T any](slice []T, comparator func(T, T) bool) T ``` -Example:[Run](https://go.dev/play/p/pbe2MT-7DV2) +Example:[Run](https://go.dev/play/p/pbe2MT-7DV2) ```go package main @@ -284,7 +282,7 @@ func main() { func Min[T constraints.Integer | constraints.Float](numbers ...T) T ``` -Example:[Run](https://go.dev/play/p/21BER_mlGUj) +Example:[Run](https://go.dev/play/p/21BER_mlGUj) ```go package main @@ -317,7 +315,7 @@ func main() { func MinBy[T any](slice []T, comparator func(T, T) bool) T ``` -Example:[Run](https://go.dev/play/p/N9qgYg_Ho6f) +Example:[Run](https://go.dev/play/p/N9qgYg_Ho6f) ```go package main @@ -361,7 +359,7 @@ func main() { func Percent(val, total float64, n int) float64 ``` -Example:[Run](https://go.dev/play/p/s0NdFCtwuyd) +Example:[Run](https://go.dev/play/p/s0NdFCtwuyd) ```go package main @@ -397,7 +395,7 @@ func main() { func RoundToFloat(x float64, n int) float64 ``` -Example:[Run](https://go.dev/play/p/ghyb528JRJL) +Example:[Run](https://go.dev/play/p/ghyb528JRJL) ```go package main @@ -433,7 +431,7 @@ func main() { func RoundToString(x float64, n int) string ``` -Example:[Run](https://go.dev/play/p/kZwpBRAcllO) +Example:[Run](https://go.dev/play/p/kZwpBRAcllO) ```go package main @@ -469,7 +467,7 @@ func main() { func TruncRound(x float64, n int) float64 ``` -Example:[Run](https://go.dev/play/p/aumarSHIGzP) +Example:[Run](https://go.dev/play/p/aumarSHIGzP) ```go package main @@ -505,7 +503,7 @@ func main() { func Range[T constraints.Integer | constraints.Float](start T, count int) []T ``` -Example:[Run](https://go.dev/play/p/9ke2opxa8ZP) +Example:[Run](https://go.dev/play/p/9ke2opxa8ZP) ```go package main @@ -544,7 +542,7 @@ func main() { func RangeWithStep[T constraints.Integer | constraints.Float](start, end, step T) []T ``` -Example:[Run](https://go.dev/play/p/akLWz0EqOSM) +Example:[Run](https://go.dev/play/p/akLWz0EqOSM) ```go package main @@ -583,7 +581,7 @@ func main() { func AngleToRadian(angle float64) float64 ``` -Example:[Run](https://go.dev/play/p/CIvlICqrHql) +Example:[Run](https://go.dev/play/p/CIvlICqrHql) ```go package main @@ -619,7 +617,7 @@ func main() { func RadianToAngle(radian float64) float64 ``` -Example:[Run](https://go.dev/play/p/dQtmOTUOMgi) +Example:[Run](https://go.dev/play/p/dQtmOTUOMgi) ```go package main @@ -655,7 +653,7 @@ func main() { func PointDistance(x1, y1, x2, y2 float64) float64 ``` -Example:[Run](https://go.dev/play/p/RrG4JIaziM8) +Example:[Run](https://go.dev/play/p/RrG4JIaziM8) ```go package main @@ -685,7 +683,7 @@ func main() { func IsPrime(n int) bool ``` -Example:[Run](https://go.dev/play/p/Rdd8UTHZJ7u) +Example:[Run](https://go.dev/play/p/Rdd8UTHZJ7u) ```go package main @@ -724,7 +722,7 @@ func main() { func GCD[T constraints.Integer](integers ...T) T ``` -Example:[Run](https://go.dev/play/p/CiEceLSoAKB) +Example:[Run](https://go.dev/play/p/CiEceLSoAKB) ```go package main @@ -766,7 +764,7 @@ func main() { func LCM[T constraints.Integer](integers ...T) T ``` -Example:[Run](https://go.dev/play/p/EjcZxfY7G_g) +Example:[Run](https://go.dev/play/p/EjcZxfY7G_g) ```go package main @@ -802,7 +800,7 @@ func main() { func Cos(radian float64, precision ...int) float64 ``` -Example:[Run](https://go.dev/play/p/Sm89LoIfvFq) +Example:[Run](https://go.dev/play/p/Sm89LoIfvFq) ```go package main @@ -844,7 +842,7 @@ func main() { func Sin(radian float64, precision ...int) float64 ``` -Example:[Run](https://go.dev/play/p/TWMQlMywDsP) +Example:[Run](https://go.dev/play/p/TWMQlMywDsP) ```go package main @@ -886,7 +884,7 @@ func main() { func Log(n, base float64) float64 ``` -Example:[Run](https://go.dev/play/p/_d4bi8oyhat) +Example:[Run](https://go.dev/play/p/_d4bi8oyhat) ```go package main @@ -922,7 +920,7 @@ func main() { func Sum[T constraints.Integer | constraints.Float](numbers ...T) T ``` -Example:[Run](https://go.dev/play/p/1To2ImAMJA7) +Example:[Run](https://go.dev/play/p/1To2ImAMJA7) ```go package main @@ -955,7 +953,7 @@ func main() { func Abs[T constraints.Integer | constraints.Float](x T) T ``` -Example:[Run](https://go.dev/play/p/fsyBh1Os-1d) +Example:[Run](https://go.dev/play/p/fsyBh1Os-1d) ```go package main diff --git a/docs/en/api/packages/netutil.md b/docs/en/api/packages/netutil.md index 0fa82a0..7271a2f 100644 --- a/docs/en/api/packages/netutil.md +++ b/docs/en/api/packages/netutil.md @@ -65,7 +65,7 @@ import ( func ConvertMapToQueryString(param map[string]any) string ``` -Example:[Run](https://go.dev/play/p/jnNt_qoSnRi) +Example:[Run](https://go.dev/play/p/jnNt_qoSnRi) ```go package main @@ -98,7 +98,7 @@ func main() { func EncodeUrl(urlStr string) (string, error) ``` -Example:[Run](https://go.dev/play/p/bsZ6BRC4uKI) +Example:[Run](https://go.dev/play/p/bsZ6BRC4uKI) ```go package main @@ -133,7 +133,7 @@ func main() { func GetInternalIp() string ``` -Example:[Run](https://go.dev/play/p/5mbu-gFp7ei) +Example:[Run](https://go.dev/play/p/5mbu-gFp7ei) ```go package main @@ -165,7 +165,7 @@ func main() { func GetIps() []string ``` -Example:[Run](https://go.dev/play/p/NUFfcEmukx1) +Example:[Run](https://go.dev/play/p/NUFfcEmukx1) ```go package main @@ -195,7 +195,7 @@ func main() { func GetMacAddrs() []string { ``` -Example:[Run](https://go.dev/play/p/Rq9UUBS_Xp1) +Example:[Run](https://go.dev/play/p/Rq9UUBS_Xp1) ```go package main @@ -239,7 +239,7 @@ type PublicIpInfo struct { } ``` -Example:[Run](https://go.dev/play/p/YDxIfozsRHR) +Example:[Run](https://go.dev/play/p/YDxIfozsRHR) ```go package main @@ -269,7 +269,7 @@ func main() { func GetRequestPublicIp(req *http.Request) string ``` -Example:[Run](https://go.dev/play/p/kxU-YDc_eBo) +Example:[Run](https://go.dev/play/p/kxU-YDc_eBo) ```go package main @@ -307,7 +307,7 @@ func main() { func IsPublicIP(IP net.IP) bool ``` -Example:[Run](https://go.dev/play/p/nmktSQpJZnn) +Example:[Run](https://go.dev/play/p/nmktSQpJZnn) ```go package main @@ -344,7 +344,7 @@ func main() { func IsInternalIP(IP net.IP) bool ``` -Example:[Run](https://go.dev/play/p/sYGhXbgO4Cb) +Example:[Run](https://go.dev/play/p/sYGhXbgO4Cb) ```go package main @@ -388,7 +388,7 @@ type HttpRequest struct { } ``` -Example:[Run](https://go.dev/play/p/jUSgynekH7G) +Example:[Run](https://go.dev/play/p/jUSgynekH7G) ```go package main @@ -445,7 +445,7 @@ func NewHttpClientWithConfig(config *HttpClientConfig) *HttpClient ``` -Example:[Run](https://go.dev/play/p/jUSgynekH7G) +Example:[Run](https://go.dev/play/p/jUSgynekH7G) ```go package main @@ -476,7 +476,7 @@ func main() { func (client *HttpClient) SendRequest(request *HttpRequest) (*http.Response, error) ``` -Example:[Run](https://go.dev/play/p/jUSgynekH7G) +Example:[Run](https://go.dev/play/p/jUSgynekH7G) ```go package main @@ -530,7 +530,7 @@ func main() { func (client *HttpClient) DecodeResponse(resp *http.Response, target any) error ``` -Example:[Run](https://go.dev/play/p/jUSgynekH7G) +Example:[Run](https://go.dev/play/p/jUSgynekH7G) ```go package main @@ -584,7 +584,7 @@ func main() { func StructToUrlValues(targetStruct any) url.Values ``` -Example:[Run](https://go.dev/play/p/pFqMkM40w9z) +Example:[Run](https://go.dev/play/p/pFqMkM40w9z) ```go package main @@ -966,7 +966,7 @@ func main() { func IsPingConnected(host string) bool ``` -Example:[Run](https://go.dev/play/p/q8OzTijsA87) +Example:[Run](https://go.dev/play/p/q8OzTijsA87) ```go package main @@ -999,7 +999,7 @@ func main() { func IsTelnetConnected(host string, port string) bool ``` -Example:[Run](https://go.dev/play/p/yiLCGtQv_ZG) +Example:[Run](https://go.dev/play/p/yiLCGtQv_ZG) ```go package main diff --git a/docs/en/api/packages/pointer.md b/docs/en/api/packages/pointer.md index 1d84f25..a3d6838 100644 --- a/docs/en/api/packages/pointer.md +++ b/docs/en/api/packages/pointer.md @@ -30,8 +30,6 @@ import (
- - ## Documentation ### Of @@ -44,7 +42,7 @@ import ( func Of[T any](v T) *T ``` -Example:[Run](https://go.dev/play/p/HFd70x4DrMj) +Example:[Run](https://go.dev/play/p/HFd70x4DrMj) ```go package main @@ -78,7 +76,7 @@ func main() { func Unwrap[T any](p *T) T ``` -Example:[Run](https://go.dev/play/p/cgeu3g7cjWb) +Example:[Run](https://go.dev/play/p/cgeu3g7cjWb) ```go package main @@ -114,7 +112,7 @@ func main() { UnwarpOr[T any](p *T, fallback T) T ``` -Example:[Run](https://go.dev/play/p/mmNaLC38W8C) +Example:[Run](https://go.dev/play/p/mmNaLC38W8C) ```go package main @@ -159,7 +157,7 @@ func main() { UnwarpOrDefault[T any](p *T) T ``` -Example:[Run](https://go.dev/play/p/ZnGIHf8_o4E) +Example:[Run](https://go.dev/play/p/ZnGIHf8_o4E) ```go package main @@ -205,7 +203,7 @@ func main() { func ExtractPointer(value any) any ``` -Example:[Run](https://go.dev/play/p/D7HFjeWU2ZP) +Example:[Run](https://go.dev/play/p/D7HFjeWU2ZP) ```go package main diff --git a/docs/en/api/packages/random.md b/docs/en/api/packages/random.md index 8ecb849..ed5531d 100644 --- a/docs/en/api/packages/random.md +++ b/docs/en/api/packages/random.md @@ -34,8 +34,6 @@ import (
- - ## Documentation ### RandBytes @@ -48,7 +46,7 @@ import ( func RandBytes(length int) []byte ``` -Example:[Run](https://go.dev/play/p/EkiLESeXf8d) +Example:[Run](https://go.dev/play/p/EkiLESeXf8d) ```go package main @@ -74,7 +72,7 @@ func main() { func RandInt(min, max int) int ``` -Example:[Run](https://go.dev/play/p/pXyyAAI5YxD) +Example:[Run](https://go.dev/play/p/pXyyAAI5YxD) ```go package main @@ -100,7 +98,7 @@ func main() { func RandString(length int) string ``` -Example:[Run](https://go.dev/play/p/W2xvRUXA7Mi) +Example:[Run](https://go.dev/play/p/W2xvRUXA7Mi) ```go package main @@ -126,7 +124,7 @@ func main() { func RandUpper(length int) string ``` -Example:[Run](https://go.dev/play/p/29QfOh0DVuh) +Example:[Run](https://go.dev/play/p/29QfOh0DVuh) ```go package main @@ -152,7 +150,7 @@ func main() { func RandLower(length int) string ``` -Example:[Run](https://go.dev/play/p/XJtZ471cmtI) +Example:[Run](https://go.dev/play/p/XJtZ471cmtI) ```go package main @@ -178,7 +176,7 @@ func main() { func RandNumeral(length int) string ``` -Example:[Run](https://go.dev/play/p/g4JWVpHsJcf) +Example:[Run](https://go.dev/play/p/g4JWVpHsJcf) ```go package main @@ -204,7 +202,7 @@ func main() { func RandNumeralOrLetter(length int) string ``` -Example:[Run](https://go.dev/play/p/19CEQvpx2jD) +Example:[Run](https://go.dev/play/p/19CEQvpx2jD) ```go package main @@ -230,7 +228,7 @@ func main() { func UUIdV4() (string, error) ``` -Example:[Run](https://go.dev/play/p/_Z9SFmr28ft) +Example:[Run](https://go.dev/play/p/_Z9SFmr28ft) ```go package main @@ -260,7 +258,7 @@ func main() { func RandUniqueIntSlice(n, min, max int) []int ``` -Example:[Run](https://go.dev/play/p/uBkRSOz73Ec) +Example:[Run](https://go.dev/play/p/uBkRSOz73Ec) ```go package main diff --git a/docs/en/api/packages/retry.md b/docs/en/api/packages/retry.md index 64be7f6..734de3b 100644 --- a/docs/en/api/packages/retry.md +++ b/docs/en/api/packages/retry.md @@ -30,8 +30,6 @@ import (
- - ## Documentation ### Context @@ -44,7 +42,7 @@ import ( func Context(ctx context.Context) ``` -Example:[Run](https://go.dev/play/p/xnAOOXv9GkS) +Example:[Run](https://go.dev/play/p/xnAOOXv9GkS) ```go import ( @@ -91,7 +89,7 @@ func main() { type RetryFunc func() error ``` -Example:[Run](https://go.dev/play/p/nk2XRmagfVF) +Example:[Run](https://go.dev/play/p/nk2XRmagfVF) ```go package main @@ -137,7 +135,7 @@ func main() { func RetryTimes(n uint) ``` -Example:[Run](https://go.dev/play/p/ssfVeU2SwLO) +Example:[Run](https://go.dev/play/p/ssfVeU2SwLO) ```go package main @@ -180,7 +178,7 @@ func main() { func RetryDuration(d time.Duration) ``` -Example:[Run](https://go.dev/play/p/nk2XRmagfVF) +Example:[Run](https://go.dev/play/p/nk2XRmagfVF) ```go package main @@ -226,7 +224,7 @@ func main() { func Retry(retryFunc RetryFunc, opts ...Option) error ``` -Example:[Run](https://go.dev/play/p/nk2XRmagfVF) +Example:[Run](https://go.dev/play/p/nk2XRmagfVF) ```go package main diff --git a/docs/en/api/packages/slice.md b/docs/en/api/packages/slice.md index 23fd4b3..5060126 100644 --- a/docs/en/api/packages/slice.md +++ b/docs/en/api/packages/slice.md @@ -94,8 +94,6 @@ import (
- - ## Documentation ### AppendIfAbsent @@ -108,7 +106,7 @@ import ( func AppendIfAbsent[T comparable](slice []T, item T) []T ``` -Example:[Run](https://go.dev/play/p/GNdv7Jg2Taj) +Example:[Run](https://go.dev/play/p/GNdv7Jg2Taj) ```go import ( @@ -139,7 +137,7 @@ func main() { func Contain[T comparable](slice []T, target T) bool ``` -Example:[Run](https://go.dev/play/p/_454yEHcNjf) +Example:[Run](https://go.dev/play/p/_454yEHcNjf) ```go import ( @@ -170,7 +168,7 @@ func main() { func ContainBy[T any](slice []T, predicate func(item T) bool) bool ``` -Example:[Run](https://go.dev/play/p/49tkHfX4GNc) +Example:[Run](https://go.dev/play/p/49tkHfX4GNc) ```go import ( @@ -215,7 +213,7 @@ func main() { func ContainSubSlice[T comparable](slice, subSlice []T) bool ``` -Example:[Run](https://go.dev/play/p/bcuQ3UT6Sev) +Example:[Run](https://go.dev/play/p/bcuQ3UT6Sev) ```go import ( @@ -246,7 +244,7 @@ func main() { func Chunk[T any](slice []T, size int) [][]T ``` -Example:[Run](https://go.dev/play/p/b4Pou5j2L_C) +Example:[Run](https://go.dev/play/p/b4Pou5j2L_C) ```go import ( @@ -288,7 +286,7 @@ func main() { func Compact[T comparable](slice []T) []T ``` -Example:[Run](https://go.dev/play/p/pO5AnxEr3TK) +Example:[Run](https://go.dev/play/p/pO5AnxEr3TK) ```go import ( @@ -325,7 +323,7 @@ func main() { func Concat[T any](slice []T, slices ...[]T) []T ``` -Example:[Run](https://go.dev/play/p/gPt-q7zr5mk) +Example:[Run](https://go.dev/play/p/gPt-q7zr5mk) ```go import ( @@ -356,7 +354,7 @@ func main() { func Count[T comparable](slice []T, item T) int ``` -Example:[Run](https://go.dev/play/p/Mj4oiEnQvRJ) +Example:[Run](https://go.dev/play/p/Mj4oiEnQvRJ) ```go import ( @@ -389,7 +387,7 @@ func main() { func CountBy[T any](slice []T, predicate func(index int, item T) bool) int ``` -Example:[Run](https://go.dev/play/p/tHOccTMDZCC) +Example:[Run](https://go.dev/play/p/tHOccTMDZCC) ```go import ( @@ -423,7 +421,7 @@ func main() { func Difference[T comparable](slice, comparedSlice []T) []T ``` -Example:[Run](https://go.dev/play/p/VXvadzLzhDa) +Example:[Run](https://go.dev/play/p/VXvadzLzhDa) ```go import ( @@ -454,7 +452,7 @@ func main() { func DifferenceBy[T comparable](slice []T, comparedSlice []T, iteratee func(index int, item T) T) []T ``` -Example:[Run](https://go.dev/play/p/DiivgwM5OnC) +Example:[Run](https://go.dev/play/p/DiivgwM5OnC) ```go import ( @@ -489,7 +487,7 @@ func main() { func DifferenceWith[T any](slice []T, comparedSlice []T, comparator func(value, otherValue T) bool) []T ``` -Example:[Run](https://go.dev/play/p/v2U2deugKuV) +Example:[Run](https://go.dev/play/p/v2U2deugKuV) ```go import ( @@ -524,7 +522,7 @@ func main() { func DeleteAt[T any](slice []T, start int, end ...int) ``` -Example:[Run](https://go.dev/play/p/pJ-d6MUWcvK) +Example:[Run](https://go.dev/play/p/pJ-d6MUWcvK) ```go import ( @@ -558,7 +556,7 @@ func main() { func Drop[T any](slice []T, n int) []T ``` -Example:[Run](https://go.dev/play/p/jnPO2yQsT8H) +Example:[Run](https://go.dev/play/p/jnPO2yQsT8H) ```go import ( @@ -595,7 +593,7 @@ func main() { func DropRight[T any](slice []T, n int) []T ``` -Example:[Run](https://go.dev/play/p/8bcXvywZezG) +Example:[Run](https://go.dev/play/p/8bcXvywZezG) ```go import ( @@ -632,7 +630,7 @@ func main() { func DropWhile[T any](slice []T, predicate func(item T) bool) []T ``` -Example:[Run](https://go.dev/play/p/4rt252UV_qs) +Example:[Run](https://go.dev/play/p/4rt252UV_qs) ```go import ( @@ -672,7 +670,7 @@ func main() { func DropRightWhile[T any](slice []T, predicate func(item T) bool) []T ``` -Example:[Run](https://go.dev/play/p/6wyK3zMY56e) +Example:[Run](https://go.dev/play/p/6wyK3zMY56e) ```go import ( @@ -714,7 +712,7 @@ func main() { func Equal[T comparable](slice1, slice2 []T) bool ``` -Example:[Run](https://go.dev/play/p/WcRQJ37ifPa) +Example:[Run](https://go.dev/play/p/WcRQJ37ifPa) ```go import ( @@ -749,7 +747,7 @@ func main() { func EqualWith[T, U any](slice1 []T, slice2 []U, comparator func(T, U) bool) bool ``` -Example:[Run](https://go.dev/play/p/b9iygtgsHI1) +Example:[Run](https://go.dev/play/p/b9iygtgsHI1) ```go import ( @@ -784,7 +782,7 @@ func main() { func Every[T any](slice []T, predicate func(index int, item T) bool) bool ``` -Example:[Run](https://go.dev/play/p/R8U6Sl-j8cD) +Example:[Run](https://go.dev/play/p/R8U6Sl-j8cD) ```go import ( @@ -818,7 +816,7 @@ func main() { func Filter[T any](slice []T, predicate func(index int, item T) bool) []T ``` -Example:[Run](https://go.dev/play/p/SdPna-7qK4T) +Example:[Run](https://go.dev/play/p/SdPna-7qK4T) ```go import ( @@ -852,7 +850,7 @@ func main() { func Find[T any](slice []T, predicate func(index int, item T) bool) (*T, bool) ``` -Example:[Run](https://go.dev/play/p/CBKeBoHVLgq) +Example:[Run](https://go.dev/play/p/CBKeBoHVLgq) ```go import ( @@ -888,7 +886,7 @@ func main() { func FindBy[T any](slice []T, predicate func(index int, item T) bool) (v T, ok bool) ``` -Example:[Run](https://go.dev/play/p/n1lysBYl-GB) +Example:[Run](https://go.dev/play/p/n1lysBYl-GB) ```go import ( @@ -924,7 +922,7 @@ func main() { func FindLast[T any](slice []T, predicate func(index int, item T) bool) (*T, bool) ``` -Example:[Run](https://go.dev/play/p/FFDPV_j7URd) +Example:[Run](https://go.dev/play/p/FFDPV_j7URd) ```go import ( @@ -960,7 +958,7 @@ func main() { func FindLastBy[T any](slice []T, predicate func(index int, item T) bool) (v T, ok bool) ``` -Example:[Run](https://go.dev/play/p/8iqomzyCl_s) +Example:[Run](https://go.dev/play/p/8iqomzyCl_s) ```go import ( @@ -996,7 +994,7 @@ func main() { func Flatten(slice any) any ``` -Example:[Run](https://go.dev/play/p/hYa3cBEevtm) +Example:[Run](https://go.dev/play/p/hYa3cBEevtm) ```go import ( @@ -1026,7 +1024,7 @@ func main() { func FlattenDeep(slice any) any ``` -Example:[Run](https://go.dev/play/p/yjYNHPyCFaF) +Example:[Run](https://go.dev/play/p/yjYNHPyCFaF) ```go import ( @@ -1056,7 +1054,7 @@ func main() { func ForEach[T any](slice []T, iteratee func(index int, item T)) ``` -Example:[Run](https://go.dev/play/p/DrPaa4YsHRF) +Example:[Run](https://go.dev/play/p/DrPaa4YsHRF) ```go import ( @@ -1091,7 +1089,7 @@ func main() { func ForEachWithBreak[T any](slice []T, iteratee func(index int, item T) bool) ``` -Example:[Run](https://go.dev/play/p/qScs39f3D9W) +Example:[Run](https://go.dev/play/p/qScs39f3D9W) ```go import ( @@ -1129,7 +1127,7 @@ func main() { func GroupBy[T any](slice []T, groupFn func(index int, item T) bool) ([]T, []T) ``` -Example:[Run](https://go.dev/play/p/QVkPxzPR0iA) +Example:[Run](https://go.dev/play/p/QVkPxzPR0iA) ```go import ( @@ -1165,7 +1163,7 @@ func main() { func GroupWith[T any, U comparable](slice []T, iteratee func(T) U) map[U][]T ``` -Example:[Run](https://go.dev/play/p/ApCvMNTLO8a) +Example:[Run](https://go.dev/play/p/ApCvMNTLO8a) ```go import ( @@ -1199,7 +1197,7 @@ func main() { func IntSlice(slice any) []int ``` -Example:[Run](https://go.dev/play/p/UQDj-on9TGN) +Example:[Run](https://go.dev/play/p/UQDj-on9TGN) ```go import ( @@ -1228,7 +1226,7 @@ func main() { func InterfaceSlice(slice any) []any ``` -Example:[Run](https://go.dev/play/p/FdQXF0Vvqs-) +Example:[Run](https://go.dev/play/p/FdQXF0Vvqs-) ```go import ( @@ -1257,7 +1255,7 @@ func main() { func Intersection[T comparable](slices ...[]T) []T ``` -Example:[Run](https://go.dev/play/p/anJXfB5wq_t) +Example:[Run](https://go.dev/play/p/anJXfB5wq_t) ```go import ( @@ -1288,7 +1286,7 @@ func main() { func InsertAt[T any](slice []T, index int, value any) []T ``` -Example:[Run](https://go.dev/play/p/hMLNxPEGJVE) +Example:[Run](https://go.dev/play/p/hMLNxPEGJVE) ```go import ( @@ -1328,7 +1326,7 @@ func main() { func IndexOf[T comparable](slice []T, item T) int ``` -Example:[Run](https://go.dev/play/p/MRN1f0FpABb) +Example:[Run](https://go.dev/play/p/MRN1f0FpABb) ```go import ( @@ -1361,7 +1359,7 @@ func main() { func LastIndexOf[T comparable](slice []T, item T) int ``` -Example:[Run](https://go.dev/play/p/DokM4cf1IKH) +Example:[Run](https://go.dev/play/p/DokM4cf1IKH) ```go import ( @@ -1394,7 +1392,7 @@ func main() { func Map[T any, U any](slice []T, iteratee func(index int, item T) U) []U ``` -Example:[Run](https://go.dev/play/p/biaTefqPquw) +Example:[Run](https://go.dev/play/p/biaTefqPquw) ```go import ( @@ -1428,7 +1426,7 @@ func main() { func FilterMap[T any, U any](slice []T, iteratee func(index int, item T) (U, bool)) []U ``` -Example:[Run](https://go.dev/play/p/J94SZ_9MiIe) +Example:[Run](https://go.dev/play/p/J94SZ_9MiIe) ```go import ( @@ -1465,7 +1463,7 @@ func main() { func FlatMap[T any, U any](slice []T, iteratee func(index int, item T) []U) []U ``` -Example:[Run](https://go.dev/play/p/_QARWlWs1N_F) +Example:[Run](https://go.dev/play/p/_QARWlWs1N_F) ```go import ( @@ -1498,7 +1496,7 @@ func main() { func Merge[T any](slices ...[]T) []T ``` -Example:[Run](https://go.dev/play/p/lbjFp784r9N) +Example:[Run](https://go.dev/play/p/lbjFp784r9N) ```go import ( @@ -1529,7 +1527,7 @@ func main() { func Reverse[T any](slice []T) ``` -Example:[Run](https://go.dev/play/p/8uI8f1lwNrQ) +Example:[Run](https://go.dev/play/p/8uI8f1lwNrQ) ```go import ( @@ -1559,7 +1557,7 @@ func main() { func Reduce[T any](slice []T, iteratee func(index int, item1, item2 T) T, initial T) T ``` -Example:[Run](https://go.dev/play/p/_RfXJJWIsIm) +Example:[Run](https://go.dev/play/p/_RfXJJWIsIm) ```go import ( @@ -1593,7 +1591,7 @@ func main() { func ReduceBy[T any, U any](slice []T, initial U, reducer func(index int, item T, agg U) U) U ``` -Example:[Run](https://go.dev/play/p/YKDpLi7gtee) +Example:[Run](https://go.dev/play/p/YKDpLi7gtee) ```go import ( @@ -1629,7 +1627,7 @@ func main() { func ReduceRight[T any, U any](slice []T, initial U, reducer func(index int, item T, agg U) U) U ``` -Example:[Run](https://go.dev/play/p/qT9dZC03A1K) +Example:[Run](https://go.dev/play/p/qT9dZC03A1K) ```go import ( @@ -1659,7 +1657,7 @@ func main() { func Replace[T comparable](slice []T, old T, new T, n int) []T ``` -Example:[Run](https://go.dev/play/p/P5mZp7IhOFo) +Example:[Run](https://go.dev/play/p/P5mZp7IhOFo) ```go import ( @@ -1701,7 +1699,7 @@ func main() { func ReplaceAll[T comparable](slice []T, old T, new T) []T ``` -Example:[Run](https://go.dev/play/p/CzqXMsuYUrx) +Example:[Run](https://go.dev/play/p/CzqXMsuYUrx) ```go import ( @@ -1729,7 +1727,7 @@ func main() { func Repeat[T any](item T, n int) []T ``` -Example:[Run](https://go.dev/play/p/1CbOmtgILUU) +Example:[Run](https://go.dev/play/p/1CbOmtgILUU) ```go import ( @@ -1757,7 +1755,7 @@ func main() { func Shuffle[T any](slice []T) []T ``` -Example:[Run](https://go.dev/play/p/YHvhnWGU3Ge) +Example:[Run](https://go.dev/play/p/YHvhnWGU3Ge) ```go import ( @@ -1786,7 +1784,7 @@ func main() { func IsAscending[T constraints.Ordered](slice []T) bool ``` -Example:[Run](https://go.dev/play/p/9CtsFjet4SH) +Example:[Run](https://go.dev/play/p/9CtsFjet4SH) ```go import ( @@ -1820,7 +1818,7 @@ func main() { func IsDescending[T constraints.Ordered](slice []T) bool ``` -Example:[Run](https://go.dev/play/p/U_LljFXma14) +Example:[Run](https://go.dev/play/p/U_LljFXma14) ```go import ( @@ -1854,7 +1852,7 @@ func main() { func IsSorted[T constraints.Ordered](slice []T) bool ``` -Example:[Run](https://go.dev/play/p/nCE8wPLwSA-) +Example:[Run](https://go.dev/play/p/nCE8wPLwSA-) ```go import ( @@ -1888,7 +1886,7 @@ func main() { func IsSortedByKey[T any, K constraints.Ordered](slice []T, iteratee func(item T) K) bool ``` -Example:[Run](https://go.dev/play/p/tUoGB7DOHI4) +Example:[Run](https://go.dev/play/p/tUoGB7DOHI4) ```go import ( @@ -1928,7 +1926,7 @@ func main() { func Sort[T constraints.Ordered](slice []T, sortOrder ...string) ``` -Example:[Run](https://go.dev/play/p/V9AVjzf_4Fk) +Example:[Run](https://go.dev/play/p/V9AVjzf_4Fk) ```go import ( @@ -1965,7 +1963,7 @@ func main() { func SortBy[T any](slice []T, less func(a, b T) bool) ``` -Example:[Run](https://go.dev/play/p/DAhLQSZEumm) +Example:[Run](https://go.dev/play/p/DAhLQSZEumm) ```go import ( @@ -2012,7 +2010,7 @@ func main() { func SortByField(slice any, field string, sortType ...string) error ``` -Example:[Run](https://go.dev/play/p/fU1prOBP9p1) +Example:[Run](https://go.dev/play/p/fU1prOBP9p1) ```go import ( @@ -2053,7 +2051,7 @@ func main() { func Some[T any](slice []T, predicate func(index int, item T) bool) bool ``` -Example:[Run](https://go.dev/play/p/4pO9Xf9NDGS) +Example:[Run](https://go.dev/play/p/4pO9Xf9NDGS) ```go import ( @@ -2087,7 +2085,7 @@ func main() { func StringSlice(slice any) []string ``` -Example:[Run](https://go.dev/play/p/W0TZDWCPFcI) +Example:[Run](https://go.dev/play/p/W0TZDWCPFcI) ```go import ( @@ -2116,7 +2114,7 @@ func main() { func SymmetricDifference[T comparable](slices ...[]T) []T ``` -Example:[Run](https://go.dev/play/p/1CbOmtgILUU) +Example:[Run](https://go.dev/play/p/1CbOmtgILUU) ```go import ( @@ -2147,7 +2145,7 @@ func main() { func ToSlice[T any](items ...T) []T ``` -Example:[Run](https://go.dev/play/p/YzbzVq5kscN) +Example:[Run](https://go.dev/play/p/YzbzVq5kscN) ```go import ( @@ -2175,7 +2173,7 @@ func main() { func ToSlicePointer[T any](items ...T) []*T ``` -Example:[Run](https://go.dev/play/p/gx4tr6_VXSF) +Example:[Run](https://go.dev/play/p/gx4tr6_VXSF) ```go import ( @@ -2210,7 +2208,7 @@ func main() { func Unique[T comparable](slice []T) []T ``` -Example:[Run](https://go.dev/play/p/AXw0R3ZTE6a) +Example:[Run](https://go.dev/play/p/AXw0R3ZTE6a) ```go import ( @@ -2237,7 +2235,7 @@ func main() { func UniqueBy[T comparable](slice []T, iteratee func(item T) T) []T ``` -Example:[Run](https://go.dev/play/p/UR323iZLDpv) +Example:[Run](https://go.dev/play/p/UR323iZLDpv) ```go import ( @@ -2268,7 +2266,7 @@ func main() { func Union[T comparable](slices ...[]T) []T ``` -Example:[Run](https://go.dev/play/p/hfXV1iRIZOf) +Example:[Run](https://go.dev/play/p/hfXV1iRIZOf) ```go import ( @@ -2299,7 +2297,7 @@ func main() { func UnionBy[T any, V comparable](predicate func(item T) V, slices ...[]T) []T ``` -Example:[Run](https://go.dev/play/p/HGKHfxKQsFi) +Example:[Run](https://go.dev/play/p/HGKHfxKQsFi) ```go import ( @@ -2332,7 +2330,7 @@ func main() { func UpdateAt[T any](slice []T, index int, value T) []T ``` -Example:[Run](https://go.dev/play/p/f3mh2KloWVm) +Example:[Run](https://go.dev/play/p/f3mh2KloWVm) ```go import ( @@ -2372,7 +2370,7 @@ func main() { func Without[T comparable](slice []T, items ...T) []T ``` -Example:[Run](https://go.dev/play/p/bwhEXEypThg) +Example:[Run](https://go.dev/play/p/bwhEXEypThg) ```go import ( @@ -2400,7 +2398,7 @@ func main() { func KeyBy[T any, U comparable](slice []T, iteratee func(item T) U) map[U]T ``` -Example:[Run](https://go.dev/play/p/uXod2LWD1Kg) +Example:[Run](https://go.dev/play/p/uXod2LWD1Kg) ```go import ( @@ -2430,7 +2428,7 @@ func main() { func Join[T any](s []T, separator string) string ``` -Example:[Run](https://go.dev/play/p/huKzqwNDD7V) +Example:[Run](https://go.dev/play/p/huKzqwNDD7V) ```go import ( diff --git a/docs/en/api/packages/stream.md b/docs/en/api/packages/stream.md index 87b0d0e..6b5dfb2 100644 --- a/docs/en/api/packages/stream.md +++ b/docs/en/api/packages/stream.md @@ -51,7 +51,6 @@ import (
- ## Documentation @@ -65,7 +64,7 @@ import ( func Of[T any](elems ...T) stream[T] ``` -Example:[Run](https://go.dev/play/p/jI6_iZZuVFE) +Example:[Run](https://go.dev/play/p/jI6_iZZuVFE) ```go import ( @@ -95,7 +94,7 @@ func main() { func FromSlice[T any](source []T) stream[T] ``` -Example:[Run](https://go.dev/play/p/wywTO0XZtI4) +Example:[Run](https://go.dev/play/p/wywTO0XZtI4) ```go import ( @@ -125,7 +124,7 @@ func main() { func FromChannel[T any](source <-chan T) stream[T] ``` -Example:[Run](https://go.dev/play/p/9TZYugGMhXZ) +Example:[Run](https://go.dev/play/p/9TZYugGMhXZ) ```go import ( @@ -163,7 +162,7 @@ func main() { func FromRange[T constraints.Integer | constraints.Float](start, end, step T) stream[T] ``` -Example:[Run](https://go.dev/play/p/9Ex1-zcg-B-) +Example:[Run](https://go.dev/play/p/9Ex1-zcg-B-) ```go import ( @@ -192,7 +191,7 @@ func main() { func Generate[T any](generator func() func() (item T, ok bool)) stream[T] ``` -Example:[Run](https://go.dev/play/p/rkOWL1yA3j9) +Example:[Run](https://go.dev/play/p/rkOWL1yA3j9) ```go import ( @@ -232,7 +231,7 @@ func main() { func Concat[T any](a, b stream[T]) stream[T] ``` -Example:[Run](https://go.dev/play/p/HM4OlYk_OUC) +Example:[Run](https://go.dev/play/p/HM4OlYk_OUC) ```go import ( @@ -265,7 +264,7 @@ func main() { func (s stream[T]) Distinct() stream[T] ``` -Example:[Run](https://go.dev/play/p/eGkOSrm64cB) +Example:[Run](https://go.dev/play/p/eGkOSrm64cB) ```go import ( @@ -299,7 +298,7 @@ func main() { func (s stream[T]) Filter(predicate func(item T) bool) stream[T] ``` -Example:[Run](https://go.dev/play/p/MFlSANo-buc) +Example:[Run](https://go.dev/play/p/MFlSANo-buc) ```go import ( @@ -333,7 +332,7 @@ func main() { func (s stream[T]) Map(mapper func(item T) T) stream[T] ``` -Example:[Run](https://go.dev/play/p/OtNQUImdYko) +Example:[Run](https://go.dev/play/p/OtNQUImdYko) ```go import ( @@ -367,7 +366,7 @@ func main() { func (s stream[T]) Peek(consumer func(item T)) stream[T] ``` -Example:[Run](https://go.dev/play/p/u1VNzHs6cb2) +Example:[Run](https://go.dev/play/p/u1VNzHs6cb2) ```go import ( @@ -404,7 +403,7 @@ func main() { func (s stream[T]) Skip(n int) stream[T] ``` -Example:[Run](https://go.dev/play/p/fNdHbqjahum) +Example:[Run](https://go.dev/play/p/fNdHbqjahum) ```go import ( @@ -443,7 +442,7 @@ func main() { func (s stream[T]) Limit(maxSize int) stream[T] ``` -Example:[Run](https://go.dev/play/p/qsO4aniDcGf) +Example:[Run](https://go.dev/play/p/qsO4aniDcGf) ```go import ( @@ -482,7 +481,7 @@ func main() { func (s stream[T]) Reverse() stream[T] ``` -Example:[Run](https://go.dev/play/p/A8_zkJnLHm4) +Example:[Run](https://go.dev/play/p/A8_zkJnLHm4) ```go import ( @@ -512,7 +511,7 @@ func main() { func (s stream[T]) Range(start, end int) stream[T] ``` -Example:[Run](https://go.dev/play/p/indZY5V2f4j) +Example:[Run](https://go.dev/play/p/indZY5V2f4j) ```go import ( @@ -551,7 +550,7 @@ func main() { func (s stream[T]) Sorted(less func(a, b T) bool) stream[T] ``` -Example:[Run](https://go.dev/play/p/XXtng5uonFj) +Example:[Run](https://go.dev/play/p/XXtng5uonFj) ```go import ( @@ -583,7 +582,7 @@ func main() { func (s stream[T]) ForEach(action func(item T)) ``` -Example:[Run](https://go.dev/play/p/Dsm0fPqcidk) +Example:[Run](https://go.dev/play/p/Dsm0fPqcidk) ```go import ( @@ -616,7 +615,7 @@ func main() { func (s stream[T]) Reduce(initial T, accumulator func(a, b T) T) T ``` -Example:[Run](https://go.dev/play/p/6uzZjq_DJLU) +Example:[Run](https://go.dev/play/p/6uzZjq_DJLU) ```go import ( @@ -648,7 +647,7 @@ func main() { func (s stream[T]) FindFirst() (T, bool) ``` -Example:[Run](https://go.dev/play/p/9xEf0-6C1e3) +Example:[Run](https://go.dev/play/p/9xEf0-6C1e3) ```go import ( @@ -680,7 +679,7 @@ func main() { func (s stream[T]) FindLast() (T, bool) ``` -Example:[Run](https://go.dev/play/p/WZD2rDAW-2h) +Example:[Run](https://go.dev/play/p/WZD2rDAW-2h) ```go import ( @@ -712,7 +711,7 @@ func main() { func (s stream[T]) Max(less func(a, b T) bool) (T, bool) ``` -Example:[Run](https://go.dev/play/p/fm-1KOPtGzn) +Example:[Run](https://go.dev/play/p/fm-1KOPtGzn) ```go import ( @@ -744,7 +743,7 @@ func main() { func (s stream[T]) Min(less func(a, b T) bool) (T, bool) ``` -Example:[Run](https://go.dev/play/p/vZfIDgGNRe_0) +Example:[Run](https://go.dev/play/p/vZfIDgGNRe_0) ```go import ( @@ -776,7 +775,7 @@ func main() { func (s stream[T]) AllMatch(predicate func(item T) bool) bool ``` -Example:[Run](https://go.dev/play/p/V5TBpVRs-Cx) +Example:[Run](https://go.dev/play/p/V5TBpVRs-Cx) ```go import ( @@ -814,7 +813,7 @@ func main() { func (s stream[T]) AnyMatch(predicate func(item T) bool) bool ``` -Example:[Run](https://go.dev/play/p/PTCnWn4OxSn) +Example:[Run](https://go.dev/play/p/PTCnWn4OxSn) ```go import ( @@ -852,7 +851,7 @@ func main() { func (s stream[T]) NoneMatch(predicate func(item T) bool) bool ``` -Example:[Run](https://go.dev/play/p/iWS64pL1oo3) +Example:[Run](https://go.dev/play/p/iWS64pL1oo3) ```go import ( @@ -890,7 +889,7 @@ func main() { func (s stream[T]) Count() int ``` -Example:[Run](https://go.dev/play/p/r3koY6y_Xo-) +Example:[Run](https://go.dev/play/p/r3koY6y_Xo-) ```go import ( @@ -921,7 +920,7 @@ func main() { func (s stream[T]) ToSlice() []T ``` -Example:[Run](https://go.dev/play/p/jI6_iZZuVFE) +Example:[Run](https://go.dev/play/p/jI6_iZZuVFE) ```go import ( diff --git a/docs/en/api/packages/strutil.md b/docs/en/api/packages/strutil.md index 8e67410..767eacb 100644 --- a/docs/en/api/packages/strutil.md +++ b/docs/en/api/packages/strutil.md @@ -62,8 +62,6 @@ import (
- - ## Documentation ### After @@ -76,7 +74,7 @@ import ( func After(s, char string) string ``` -Example:[Run](https://go.dev/play/p/RbCOQqCDA7m) +Example:[Run](https://go.dev/play/p/RbCOQqCDA7m) ```go import ( @@ -116,7 +114,7 @@ func main() { func AfterLast(s, char string) string ``` -Example:[Run](https://go.dev/play/p/1TegARrb8Yn) +Example:[Run](https://go.dev/play/p/1TegARrb8Yn) ```go import ( @@ -156,7 +154,7 @@ func main() { func Before(s, char string) string ``` -Example:[Run](https://go.dev/play/p/JAWTZDS4F5w) +Example:[Run](https://go.dev/play/p/JAWTZDS4F5w) ```go import ( @@ -193,7 +191,7 @@ func main() { func BeforeLast(s, char string) string ``` -Example:[Run](https://go.dev/play/p/pJfXXAoG_Te) +Example:[Run](https://go.dev/play/p/pJfXXAoG_Te) ```go import ( @@ -230,7 +228,7 @@ func main() { func CamelCase(s string) string ``` -Example:[Run](https://go.dev/play/p/9eXP3tn2tUy) +Example:[Run](https://go.dev/play/p/9eXP3tn2tUy) ```go import ( @@ -265,7 +263,7 @@ func main() { func KebabCase(s string) string ``` -Example:[Run](https://go.dev/play/p/dcZM9Oahw-Y) +Example:[Run](https://go.dev/play/p/dcZM9Oahw-Y) ```go import ( @@ -300,7 +298,7 @@ func main() { func UpperKebabCase(s string) string ``` -Example:[Run](https://go.dev/play/p/zDyKNneyQXk) +Example:[Run](https://go.dev/play/p/zDyKNneyQXk) ```go import ( @@ -335,7 +333,7 @@ func main() { func Capitalize(s string) string ``` -Example:[Run](https://go.dev/play/p/2OAjgbmAqHZ) +Example:[Run](https://go.dev/play/p/2OAjgbmAqHZ) ```go import ( @@ -370,7 +368,7 @@ func main() { func IsString(v any) bool ``` -Example:[Run](https://go.dev/play/p/IOgq7oF9ERm) +Example:[Run](https://go.dev/play/p/IOgq7oF9ERm) ```go import ( @@ -410,7 +408,7 @@ func main() { func LowerFirst(s string) string ``` -Example:[Run](https://go.dev/play/p/CbzAyZmtJwL) +Example:[Run](https://go.dev/play/p/CbzAyZmtJwL) ```go import ( @@ -444,7 +442,7 @@ func main() { func UpperFirst(s string) string ``` -Example:[Run](https://go.dev/play/p/sBbBxRbs8MM) +Example:[Run](https://go.dev/play/p/sBbBxRbs8MM) ```go import ( @@ -478,7 +476,7 @@ func main() { func Pad(source string, size int, padStr string) string ``` -Example:[Run](https://go.dev/play/p/NzImQq-VF8q) +Example:[Run](https://go.dev/play/p/NzImQq-VF8q) ```go import ( @@ -523,7 +521,7 @@ func main() { func PadEnd(source string, size int, padStr string) string ``` -Example:[Run](https://go.dev/play/p/9xP8rN0vz--) +Example:[Run](https://go.dev/play/p/9xP8rN0vz--) ```go import ( @@ -569,7 +567,7 @@ func main() { func PadStart(source string, size int, padStr string) string ``` -Example:[Run](https://go.dev/play/p/xpTfzArDfvT) +Example:[Run](https://go.dev/play/p/xpTfzArDfvT) ```go import ( @@ -615,7 +613,7 @@ func main() { func Reverse(s string) string ``` -Example:[Run](https://go.dev/play/p/adfwalJiecD) +Example:[Run](https://go.dev/play/p/adfwalJiecD) ```go import ( @@ -646,7 +644,7 @@ func main() { func SnakeCase(s string) string ``` -Example:[Run](https://go.dev/play/p/tgzQG11qBuN) +Example:[Run](https://go.dev/play/p/tgzQG11qBuN) ```go import ( @@ -681,7 +679,7 @@ func main() { func UpperSnakeCase(s string) string ``` -Example:[Run](https://go.dev/play/p/4COPHpnLx38) +Example:[Run](https://go.dev/play/p/4COPHpnLx38) ```go import ( @@ -716,7 +714,7 @@ func main() { func SplitEx(s, sep string, removeEmptyString bool) []string ``` -Example:[Run](https://go.dev/play/p/Us-ySSbWh-3) +Example:[Run](https://go.dev/play/p/Us-ySSbWh-3) ```go import ( @@ -757,7 +755,7 @@ func main() { func Substring(s string, offset int, length uint) string ``` -Example:[Run](https://go.dev/play/p/q3sM6ehnPDp) +Example:[Run](https://go.dev/play/p/q3sM6ehnPDp) ```go import ( @@ -800,7 +798,7 @@ func main() { func Wrap(str string, wrapWith string) string ``` -Example:[Run](https://go.dev/play/p/KoZOlZDDt9y) +Example:[Run](https://go.dev/play/p/KoZOlZDDt9y) ```go import ( @@ -837,7 +835,7 @@ func main() { func Unwrap(str string, wrapToken string) string ``` -Example:[Run](https://go.dev/play/p/Ec2q4BzCpG-) +Example:[Run](https://go.dev/play/p/Ec2q4BzCpG-) ```go import ( @@ -877,7 +875,7 @@ func main() { func SplitWords(s string) []string ``` -Example:[Run](https://go.dev/play/p/KLiX4WiysMM) +Example:[Run](https://go.dev/play/p/KLiX4WiysMM) ```go import ( @@ -920,7 +918,7 @@ func main() { func WordCount(s string) int ``` -Example:[Run](https://go.dev/play/p/bj7_odx3vRf) +Example:[Run](https://go.dev/play/p/bj7_odx3vRf) ```go import ( @@ -963,7 +961,7 @@ func main() { func RemoveNonPrintable(str string) string ``` -Example:[Run](https://go.dev/play/p/og47F5x_jTZ) +Example:[Run](https://go.dev/play/p/og47F5x_jTZ) ```go import ( @@ -994,7 +992,7 @@ func main() { func StringToBytes(str string) (b []byte) ``` -Example:[Run](https://go.dev/play/p/7OyFBrf9AxA) +Example:[Run](https://go.dev/play/p/7OyFBrf9AxA) ```go import ( @@ -1025,7 +1023,7 @@ func main() { func BytesToString(bytes []byte) string ``` -Example:[Run](https://go.dev/play/p/6c68HRvJecH) +Example:[Run](https://go.dev/play/p/6c68HRvJecH) ```go import ( @@ -1054,7 +1052,7 @@ func main() { func IsBlank(str string) bool ``` -Example:[Run](https://go.dev/play/p/6zXRH_c0Qd3) +Example:[Run](https://go.dev/play/p/6zXRH_c0Qd3) ```go import ( @@ -1088,7 +1086,7 @@ func main() { func HasPrefixAny(str string, prefixes []string) bool ``` -Example:[Run](https://go.dev/play/p/8UUTl2C5slo) +Example:[Run](https://go.dev/play/p/8UUTl2C5slo) ```go import ( @@ -1119,7 +1117,7 @@ func main() { func HasSuffixAny(str string, suffixes []string) bool ``` -Example:[Run](https://go.dev/play/p/sKWpCQdOVkx) +Example:[Run](https://go.dev/play/p/sKWpCQdOVkx) ```go import ( @@ -1150,7 +1148,7 @@ func main() { func IndexOffset(str string, substr string, idxFrom int) int ``` -Example:[Run](https://go.dev/play/p/qZo4lV2fomB) +Example:[Run](https://go.dev/play/p/qZo4lV2fomB) ```go import ( @@ -1192,7 +1190,7 @@ func main() { func ReplaceWithMap(str string, replaces map[string]string) string ``` -Example:[Run](https://go.dev/play/p/h3t7CNj2Vvu) +Example:[Run](https://go.dev/play/p/h3t7CNj2Vvu) ```go import ( @@ -1225,7 +1223,7 @@ func main() { func Trim(str string, characterMask ...string) string ``` -Example:[Run](https://go.dev/play/p/Y0ilP0NRV3j) +Example:[Run](https://go.dev/play/p/Y0ilP0NRV3j) ```go import ( @@ -1262,7 +1260,7 @@ func main() { func SplitAndTrim(str, delimiter string, characterMask ...string) []string ``` -Example:[Run](https://go.dev/play/p/ZNL6o4SkYQ7) +Example:[Run](https://go.dev/play/p/ZNL6o4SkYQ7) ```go import ( @@ -1295,7 +1293,7 @@ func main() { func HideString(origin string, start, end int, replaceChar string) string ``` -Example:[Run](https://go.dev/play/p/pzbaIVCTreZ) +Example:[Run](https://go.dev/play/p/pzbaIVCTreZ) ```go import ( @@ -1334,7 +1332,7 @@ func main() { func ContainsAll(str string, substrs []string) bool ``` -Example:[Run](https://go.dev/play/p/KECtK2Os4zq) +Example:[Run](https://go.dev/play/p/KECtK2Os4zq) ```go import ( @@ -1367,7 +1365,7 @@ func main() { func ContainsAny(str string, substrs []string) bool ``` -Example:[Run](https://go.dev/play/p/dZGSSMB3LXE) +Example:[Run](https://go.dev/play/p/dZGSSMB3LXE) ```go import ( @@ -1403,7 +1401,7 @@ func main() { func RemoveWhiteSpace(str string, repalceAll bool) string ``` -Example:[Run](https://go.dev/play/p/HzLC9vsTwkf) +Example:[Run](https://go.dev/play/p/HzLC9vsTwkf) ```go import ( diff --git a/docs/en/api/packages/xerror.md b/docs/en/api/packages/xerror.md index 428d4b0..07019d4 100644 --- a/docs/en/api/packages/xerror.md +++ b/docs/en/api/packages/xerror.md @@ -58,7 +58,7 @@ type XError struct { func New(format string, args ...any) *XError ``` -Example:[Run](https://go.dev/play/p/w4oWZts7q7f) +Example:[Run](https://go.dev/play/p/w4oWZts7q7f) ```go package main @@ -87,7 +87,7 @@ func main() { func Wrap(cause error, message ...any) *XError ``` -Example:[Run](https://go.dev/play/p/5385qT2dCi4) +Example:[Run](https://go.dev/play/p/5385qT2dCi4) ```go package main @@ -118,7 +118,7 @@ func main() { func Unwrap(err error) *XError ``` -Example:[Run](https://go.dev/play/p/LKMLep723tu) +Example:[Run](https://go.dev/play/p/LKMLep723tu) ```go package main @@ -153,7 +153,7 @@ func main() { func (e *XError) Wrap(cause error) *XError ``` -Example:[Run](https://go.dev/play/p/RpjJ5u5sc97) +Example:[Run](https://go.dev/play/p/RpjJ5u5sc97) ```go package main @@ -185,7 +185,7 @@ func main() { func (e *XError) Unwrap() error ``` -Example:[Run](https://go.dev/play/p/VUXJ8BST4c6) +Example:[Run](https://go.dev/play/p/VUXJ8BST4c6) ```go package main @@ -218,7 +218,7 @@ func main() { func (e *XError) With(key string, value any) *XError ``` -Example:[Run](https://go.dev/play/p/ow8UISXX_Dp) +Example:[Run](https://go.dev/play/p/ow8UISXX_Dp) ```go package main @@ -250,7 +250,7 @@ func main() { func (e *XError) Id(id string) *XError ``` -Example:[Run](https://go.dev/play/p/X6HBlsy58U9) +Example:[Run](https://go.dev/play/p/X6HBlsy58U9) ```go package main @@ -287,7 +287,7 @@ func main() { func (e *XError) Is(target error) bool ``` -Example:[Run](https://go.dev/play/p/X6HBlsy58U9) +Example:[Run](https://go.dev/play/p/X6HBlsy58U9) ```go package main @@ -324,7 +324,7 @@ func main() { func (e *XError) Values() map[string]any ``` -Example:[Run](https://go.dev/play/p/ow8UISXX_Dp) +Example:[Run](https://go.dev/play/p/ow8UISXX_Dp) ```go package main @@ -357,7 +357,7 @@ func main() { func (e *XError) StackTrace() StackTrace ``` -Example:[Run](https://go.dev/play/p/6FAvSQpa7pc) +Example:[Run](https://go.dev/play/p/6FAvSQpa7pc) ```go package main @@ -391,7 +391,7 @@ func main() { func (e *XError) Info() *errInfo ``` -Example:[Run](https://go.dev/play/p/1ZX0ME1F-Jb) +Example:[Run](https://go.dev/play/p/1ZX0ME1F-Jb) ```go package main @@ -431,7 +431,7 @@ func main() { func (e *XError) Error() string ``` -Example:[Run](https://go.dev/play/p/w4oWZts7q7f) +Example:[Run](https://go.dev/play/p/w4oWZts7q7f) ```go package main @@ -459,7 +459,7 @@ func main() { func TryUnwrap[T any](val T, err error) T ``` -Example:[Run](https://go.dev/play/p/acyZVkNZEeW) +Example:[Run](https://go.dev/play/p/acyZVkNZEeW) ```go package main diff --git a/docs/styles/api_doc.css b/docs/styles/api_doc.css deleted file mode 100644 index 8c96556..0000000 --- a/docs/styles/api_doc.css +++ /dev/null @@ -1,4 +0,0 @@ -.run-container { - float: right; - display: inline-block; -} \ No newline at end of file