From 789f5d933dc49b2859b22bff9d265408672ec8ad Mon Sep 17 00:00:00 2001 From: dudaodong Date: Wed, 30 Aug 2023 17:52:41 +0800 Subject: [PATCH] doc: update readme file --- README.md | 1050 +++++++++++++++++++++++----------------------- README_zh-CN.md | 1058 +++++++++++++++++++++++------------------------ 2 files changed, 1054 insertions(+), 1054 deletions(-) diff --git a/README.md b/README.md index 105a2f8..43302b4 100644 --- a/README.md +++ b/README.md @@ -110,40 +110,40 @@ import "github.com/duke-git/lancet/v2/algorithm" #### Function list: - **BubbleSort** : sorts slice with bubble sort algorithm, will change the original slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#BubbleSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/algorithm.md#BubbleSort)] [[play](https://go.dev/play/p/GNdv7Jg2Taj)] - **CountSort** : sorts slice with bubble sort algorithm, don't change original slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#CountSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/algorithm.md#CountSort)] [[play](https://go.dev/play/p/tB-Umgm0DrP)] - **HeapSort** : sorts slice with heap sort algorithm, will change the original slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#HeapSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/algorithm.md#HeapSort)] [[play](https://go.dev/play/p/u6Iwa1VZS_f)] - **InsertionSort** : sorts slice with insertion sort algorithm, will change the original slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#InsertionSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/algorithm.md#InsertionSort)] [[play](https://go.dev/play/p/G5LJiWgJJW6)] - **MergeSort** : sorts slice with merge sort algorithm, will change the original slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#MergeSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/algorithm.md#MergeSort)] [[play](https://go.dev/play/p/ydinn9YzUJn)] - **QuickSort** : sorts slice with quick sort algorithm, will change the original slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#QuickSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/algorithm.md#QuickSort)] [[play](https://go.dev/play/p/7Y7c1Elk3ax)] - **SelectionSort** : sorts slice with selection sort algorithm, will change the original slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#SelectionSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/algorithm.md#SelectionSort)] [[play](https://go.dev/play/p/oXovbkekayS)] - **ShellSort** : sorts slice with shell sort algorithm, will change the original slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#ShellSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/algorithm.md#ShellSort)] [[play](https://go.dev/play/p/3ibkszpJEu3)] - **BinarySearch** : returns the index of target within a sorted slice, use binary search (recursive call itself). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#BinarySearch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/algorithm.md#BinarySearch)] [[play](https://go.dev/play/p/t6MeGiUSN47)] - **BinaryIterativeSearch** : returns the index of target within a sorted slice, use binary search (no recursive). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#BinaryIterativeSearch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/algorithm.md#BinaryIterativeSearch)] [[play](https://go.dev/play/p/Anozfr8ZLH3)] - **LinearSearch** : returns the index of target in slice base on equal function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#LinearSearch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/algorithm.md#LinearSearch)] [[play](https://go.dev/play/p/IsS7rgn5s3x)] - **LRUCache** : implements memory cache with lru algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm.md#LRUCache)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/algorithm.md#LRUCache)] [[play](https://go.dev/play/p/-EZjgOURufP)]

2. Compare package provides a lightweight comparison function on any type.        index

@@ -155,25 +155,25 @@ import "github.com/duke-git/lancet/v2/compare" #### Function list: - **Equal** : Checks if two values are equal or not. (check both type and value) - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare.md#Equal)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/compare.md#Equal)] [[play](https://go.dev/play/p/wmVxR-to4lz)] - **EqualValue** : Checks if two values are equal or not. (check value only) - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare.md#EqualValue)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/compare.md#EqualValue)] [[play](https://go.dev/play/p/fxnna_LLD9u)] - **LessThan** : Checks if value `left` less than value `right`. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare.md#LessThan)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/compare.md#LessThan)] [[play](https://go.dev/play/p/cYh7FQQj0ne)] - **GreaterThan** : Checks if value `left` greater than value `right`. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare.md#GreaterThan)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/compare.md#GreaterThan)] [[play](https://go.dev/play/p/9-NYDFZmIMp)] - **LessOrEqual** : Checks if value `left` less than or equal than value `right`. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare.md#LessOrEqual)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/compare.md#LessOrEqual)] [[play](https://go.dev/play/p/e4T_scwoQzp)] - **GreaterOrEqual** : Checks if value `left` less greater or equal than value `right`. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare.md#GreaterOrEqual)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/compare.md#GreaterOrEqual)] [[play](https://go.dev/play/p/vx8mP0U8DFk)] - **InDelta** : Checks if two values are equal or not within a delta. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare.md#InDelta)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/compare.md#InDelta)]

3. Concurrency package contain some functions to support concurrent programming. eg, goroutine, channel, async.        index

@@ -184,34 +184,34 @@ import "github.com/duke-git/lancet/v2/concurrency" #### Function list: - **NewChannel** : create a Channel pointer instance. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency.md#NewChannel)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/concurrency.md#NewChannel)] [[play](https://go.dev/play/p/7aB4KyMMp9A)] - **Bridge** : link multiply channels into one channel. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/Bridge.md#NewChannel)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/Bridge.md#NewChannel)] [[play](https://go.dev/play/p/qmWSy1NVF-Y)] - **FanIn** : merge multiple channels into one channel. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency.md#FanIn)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/concurrency.md#FanIn)] [[play](https://go.dev/play/p/2VYFMexEvTm)] - **Generate** : creates a channel, then put values into the channel. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency.md#Generate)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/concurrency.md#Generate)] [[play](https://go.dev/play/p/7aB4KyMMp9A)] - **Or** : read one or more channels into one channel, will close when any readin channel is closed. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency.md#Or)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/concurrency.md#Or)] [[play](https://go.dev/play/p/Wqz9rwioPww)] - **OrDone** : read a channel into another channel, will close until cancel context. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency.md#OrDone)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/concurrency.md#OrDone)] [[play](https://go.dev/play/p/lm_GoS6aDjo)] - **Repeat** : create channel, put values into the channel repeatly until cancel the context. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency.md#Repeat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/concurrency.md#Repeat)] [[play](https://go.dev/play/p/k5N_ALVmYjE)] - **RepeatFn** : create a channel, excutes fn repeatly, and put the result into the channel, until close context. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency.md#RepeatFn)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/concurrency.md#RepeatFn)] [[play](https://go.dev/play/p/4J1zAWttP85)] - **Take** : create a channel whose values are taken from another channel with limit number. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency.md#Take)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/concurrency.md#Take)] [[play](https://go.dev/play/p/9Utt-1pDr2J)] - **Tee** : split one chanel into two channels, until cancel the context. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency.md#Tee)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/concurrency.md#Tee)] [[play](https://go.dev/play/p/3TQPKnCirrP)]

4. Condition package contains some functions for conditional judgment. eg. And, Or, TernaryOperator...       index

@@ -223,28 +223,28 @@ import "github.com/duke-git/lancet/v2/condition" #### Function list: - **Bool** : returns the truthy value of anything. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition.md#Bool)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/condition.md#Bool)] [[play](https://go.dev/play/p/ETzeDJRSvhm)] - **And** : returns true if both a and b are truthy. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition.md#And)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/condition.md#And)] [[play](https://go.dev/play/p/W1SSUmt6pvr)] - **Or** : returns false if neither a nor b is truthy. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition.md#Or)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/condition.md#Or)] [[play](https://go.dev/play/p/UlQTxHaeEkq)] - **Xor** : returns true if a or b but not both is truthy. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition.md#Xor)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/condition.md#Xor)] [[play](https://go.dev/play/p/gObZrW7ZbG8)] - **Nor** : returns true if neither a nor b is truthy. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition.md#Nor)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/condition.md#Nor)] [[play](https://go.dev/play/p/g2j08F_zZky)] - **Xnor** : returns true if both a and b or neither a nor b are truthy. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition.md#Xnor)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/condition.md#Xnor)] [[play](https://go.dev/play/p/OuDB9g51643)] - **Nand** : returns false if both a and b are truthy. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition.md#Nand)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/condition.md#Nand)] [[play](https://go.dev/play/p/vSRMLxLIbq8)] - **TernaryOperator** : ternary operator. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition.md#TernaryOperator)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/condition.md#TernaryOperator)] [[play](https://go.dev/play/p/ElllPZY0guT)]

5. Convertor package contains some functions for data convertion.        index

@@ -256,67 +256,67 @@ import "github.com/duke-git/lancet/v2/convertor" #### Function list: - **ColorHexToRGB** : convert color hex to color rgb. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ColorHexToRGB)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ColorHexToRGB)] [[play](https://go.dev/play/p/o7_ft-JCJBV)] - **ColorRGBToHex** : convert rgb color to hex color. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ColorRGBToHex)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ColorRGBToHex)] [[play](https://go.dev/play/p/nzKS2Ro87J1)] - **ToBool** : convert string to bool. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ToBool)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToBool)] [[play](https://go.dev/play/p/ARht2WnGdIN)] - **ToBytes** : convert value to byte slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ToBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToBytes)] [[play](https://go.dev/play/p/fAMXYFDvOvr)] - **ToChar** : convert string to char slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ToChar)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToChar)] [[play](https://go.dev/play/p/JJ1SvbFkVdM)] - **ToChannel** : convert a collection of elements to a read-only channel. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ToChannel)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToChannel)] [[play](https://go.dev/play/p/hOx_oYZbAnL)] - **ToFloat** : convert value to float64, if param is a invalid floatable, will return 0.0 and error. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ToFloat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToFloat)] [[play](https://go.dev/play/p/4YTmPCibqHJ)] - **ToInt** : convert value to int64 value, if input is not numerical, return 0 and error. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ToInt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToInt)] [[play](https://go.dev/play/p/9_h9vIt-QZ_b)] - **ToJson** : convert value to a json string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ToJson)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToJson)] [[play](https://go.dev/play/p/2rLIkMmXWvR)] - **ToMap** : convert a slice of structs to a map based on iteratee function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ToMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToMap)] [[play](https://go.dev/play/p/tVFy7E-t24l)] - **ToPointer** : return a pointer of passed value. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ToPointer)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToPointer)] [[play](https://go.dev/play/p/ASf_etHNlw1)] - **ToString** : convert value to string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ToString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToString)] [[play](https://go.dev/play/p/nF1zOOslpQq)] - **StructToMap** : convert struct to map, only convert exported struct field. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#StructToMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#StructToMap)] [[play](https://go.dev/play/p/KYGYJqNUBOI)] - **MapToSlice** : convert map to slice based on iteratee function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#MapToSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#MapToSlice)] [[play](https://go.dev/play/p/dmX4Ix5V6Wl)] - **EncodeByte** : encode data to byte slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#EncodeByte)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#EncodeByte)] [[play](https://go.dev/play/p/DVmM1G5JfuP)] - **DecodeByte** : decode byte slice data to target object. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#DecodeByte)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#DecodeByte)] [[play](https://go.dev/play/p/zI6xsmuQRbn)] - **DeepClone** : creates a deep copy of passed item, can't clone unexported field of struct. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#DeepClone)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#DeepClone)] [[play](https://go.dev/play/p/j4DP5dquxnk)] - **CopyProperties** : copies each field from the source struct into the destination struct. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#CopyProperties)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#CopyProperties)] [[play](https://go.dev/play/p/oZujoB5Sgg5)] - **ToInterface** : converts reflect value to its interface type. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#ToInterface)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#ToInterface)] [[play](https://go.dev/play/p/syqw0-WG7Xd)] - **Utf8ToGbk** : converts utf8 encoding data to GBK encoding data - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#Utf8ToGbk)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#Utf8ToGbk)] [[play](https://go.dev/play/p/9FlIaFLArIL)] - **GbkToUtf8** : converts GBK encoding data to utf8 encoding data. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor.md#GbkToUtf8)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/convertor.md#GbkToUtf8)] [[play](https://go.dev/play/p/OphmHCN_9u8)]

6. Cryptor package is for data encryption and decryption.       index

@@ -328,128 +328,128 @@ import "github.com/duke-git/lancet/v2/cryptor" #### Function list: - **AesEcbEncrypt** : encrypt byte slice data with key use AES ECB algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#AesEcbEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#AesEcbEncrypt)] [[play](https://go.dev/play/p/zI6xsmuQRbn)] - **AesEcbDecrypt** : decrypt byte slice data with key use AES ECB algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#AesEcbDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#AesEcbDecrypt)] [[play](https://go.dev/play/p/zI6xsmuQRbn)] - **AesCbcEncrypt** : encrypt byte slice data with key use AES CBC algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#AesCbcEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#AesCbcEncrypt)] [[play](https://go.dev/play/p/IOq_g8_lKZD)] - **AesCbcDecrypt** : decrypt byte slice data with key use AES CBC algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#AesCbcDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#AesCbcDecrypt)] [[play](https://go.dev/play/p/IOq_g8_lKZD)] - **AesCtrCrypt** : encrypt/ decrypt byte slice data with key use AES CRC algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#AesCtrCrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#AesCtrCrypt)] [[play](https://go.dev/play/p/SpaZO0-5Nsp)] - **AesCfbEncrypt** : encrypt byte slice data with key use AES CFB algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#AesCfbEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#AesCfbEncrypt)] [[play](https://go.dev/play/p/tfkF10B13kH)] - **AesCfbDecrypt** : decrypt byte slice data with key use AES CFB algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#AesCfbDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#AesCfbDecrypt)] [[play](https://go.dev/play/p/tfkF10B13kH)] - **AesOfbEncrypt** : encrypt byte slice data with key use AES OFB algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#AesOfbEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#AesOfbEncrypt)] [[play](https://go.dev/play/p/VtHxtkUj-3F)] - **AesOfbDecrypt** : decrypt byte slice data with key use AES OFB algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#AesOfbDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#AesOfbDecrypt)] [[play](https://go.dev/play/p/VtHxtkUj-3F)] - **Base64StdEncode** : encode string with base64 encoding. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Base64StdEncode)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Base64StdEncode)] [[play](https://go.dev/play/p/VOaUyQUreoK)] - **Base64StdDecode** : decode string with base64 encoding. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Base64StdDecode)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Base64StdDecode)] [[play](https://go.dev/play/p/RWQylnJVgIe)] - **DesEcbEncrypt** : encrypt byte slice data with key use DES ECB algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#DesEcbEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#DesEcbEncrypt)] [[play](https://go.dev/play/p/8qivmPeZy4P)] - **DesEcbDecrypt** : decrypt byte slice data with key use DES ECB algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#DesEcbDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#DesEcbDecrypt)] [[play](https://go.dev/play/p/8qivmPeZy4P)] - **DesCbcEncrypt** : encrypt byte slice data with key use DES CBC algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#DesCbcEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#DesCbcEncrypt)] [[play](https://go.dev/play/p/4cC4QvWfe3_1)] - **DesCbcDecrypt** : decrypt byte slice data with key use DES CBC algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#DesCbcDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#DesCbcDecrypt)] [[play](https://go.dev/play/p/4cC4QvWfe3_1)] - **DesCtrCrypt** : encrypt/decrypt byte slice data with key use DES CRY algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#DesCtrCrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#DesCtrCrypt)] [[play](https://go.dev/play/p/9-T6OjKpcdw)] - **DesCfbEncrypt** : encrypt byte slice data with key use DES CFB algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#DesCfbEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#DesCfbEncrypt)] [[play](https://go.dev/play/p/y-eNxcFBlxL)] - **DesCfbDecrypt** : decrypt byte slice data with key use DES CFB algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#DesCfbDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#DesCfbDecrypt)] [[play](https://go.dev/play/p/y-eNxcFBlxL)] - **DesOfbEncrypt** : encrypt byte slice data with key use DES OFB algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#DesOfbEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#DesOfbEncrypt)] [[play](https://go.dev/play/p/74KmNadjN1J)] - **DesOfbDecrypt** : decrypt byte slice data with key use DES OFB algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#DesOfbDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#DesOfbDecrypt)] [[play](https://go.dev/play/p/74KmNadjN1J)] - **HmacMd5** : return the md5 hmac hash of string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#HmacMd5)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#HmacMd5)] [[play](https://go.dev/play/p/uef0q1fz53I)] - **HmacMd5WithBase64** : return the md5 hmac hash of base64 string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#HmacMd5WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#HmacMd5WithBase64)] - **HmacSha1** : return the hmac hash of string use sha1. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#HmacSha1)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#HmacSha1)] [[play](https://go.dev/play/p/1UI4oQ4WXKM)] - **HmacSha1WithBase64** : return the hmac hash of string use sha1 with base64. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#HmacSha1WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#HmacSha1WithBase64)] [[play](https://go.dev/play/p/47JmmGrnF7B)] - **HmacSha256** : return the hmac hash of string use sha256. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#HmacSha256)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#HmacSha256)] [[play](https://go.dev/play/p/HhpwXxFhhC0)] - **HmacSha256WithBase64** : return the hmac hash of string use sha256 with base64. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#HmacSha256WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#HmacSha256WithBase64)] [[play](https://go.dev/play/p/EKbkUvPTLwO)] - **HmacSha512** : return the hmac hash of string use sha512. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#HmacSha512)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#HmacSha512)] [[play](https://go.dev/play/p/59Od6m4A0Ud)] - **HmacSha512WithBase64** : return the hmac hash of string use sha512 with base64. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#HmacSha512WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#HmacSha512WithBase64)] [[play](https://go.dev/play/p/c6dSe3E2ydU)] - **Md5Byte** : return the md5 string of byte slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Md5Byte)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Md5Byte)] [[play](https://go.dev/play/p/suraalH8lyC)] - **Md5ByteWithBase64** : return the md5 string of byte slice with base64. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Md5ByteWithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Md5ByteWithBase64)] [[play](https://go.dev/play/p/Tcb-Z7LN2ax)] - **Md5String** : return the md5 value of string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Md5String)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Md5String)] [[play](https://go.dev/play/p/1bLcVetbTOI)] - **Md5StringWithBase64** : return the md5 value of string with base64. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Md5StringWithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Md5StringWithBase64)] [[play](https://go.dev/play/p/Lx4gH7Vdr5_y)] - **Md5File** : return the md5 value of file. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Md5File)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Md5File)] - **Sha1** : return the sha1 value (SHA-1 hash algorithm) of base64 string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Sha1)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Sha1)] [[play](https://go.dev/play/p/_m_uoD1deMT)] - **Sha1WithBase64** : return the sha1 value (SHA-1 hash algorithm) of string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Sha1WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Sha1WithBase64)] [[play](https://go.dev/play/p/fSyx-Gl2l2-)] - **Sha256** : return the sha256 value (SHA-256 hash algorithm) of string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Sha256)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Sha256)] [[play](https://go.dev/play/p/tU9tfBMIAr1)] - **Sha256WithBase64** : return the sha256 value (SHA256 hash algorithm) of base64 string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Sha256WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Sha256WithBase64)] [[play](https://go.dev/play/p/85IXJHIal1k)] - **Sha512** : return the sha512 value (SHA-512 hash algorithm) of string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Sha512)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Sha512)] [[play](https://go.dev/play/p/3WsvLYZxsHa)] - **Sha512WithBase64** : return the sha512 value (SHA-512 hash algorithm) of base64 string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#Sha512WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#Sha512WithBase64)] [[play](https://go.dev/play/p/q_fY2rA-k5I)] - **GenerateRsaKey** : create rsa private and public pemo file. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#GenerateRsaKey)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#GenerateRsaKey)] [[play](https://go.dev/play/p/zutRHrDqs0X)] - **RsaEncrypt** : encrypt data with ras algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#RsaEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#RsaEncrypt)] [[play](https://go.dev/play/p/uef0q1fz53I)] - **RsaDecrypt** : decrypt data with ras algorithm. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#RsaDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/cryptor.md#RsaDecrypt)] [[play](https://go.dev/play/p/uef0q1fz53I)]

7. Datetime package supports date and time format and compare.        index

@@ -461,129 +461,129 @@ import "github.com/duke-git/lancet/v2/datetime" #### Function list: - **AddDay** : add or sub day to the time. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#AddDay)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#AddDay)] [[play](https://go.dev/play/p/dIGbs_uTdFa)] - **AddHour** : add or sub day to the time. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#AddHour)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#AddHour)] [[play](https://go.dev/play/p/rcMjd7OCsi5)] - **AddMinute** : add or sub day to the time. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#AddMinute)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#AddMinute)] [[play](https://go.dev/play/p/nT1heB1KUUK)] - **AddYear** : add or sub year to the time. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#AddYear)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#AddYear)] [[play](https://go.dev/play/p/MqW2ujnBx10)] - **BeginOfMinute** : return the date time at the begin of minute of specific date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#BeginOfMinute)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#BeginOfMinute)] [[play](https://go.dev/play/p/ieOLVJ9CiFT)] - **BeginOfHour** : return the date time at the begin of hour of specific date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#BeginOfHour)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#BeginOfHour)] [[play](https://go.dev/play/p/GhdGFnDWpYs)] - **BeginOfDay** : return the date time at the begin of day of specific date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#BeginOfDay)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#BeginOfDay)] [[play](https://go.dev/play/p/94m_UT6cWs9)] - **BeginOfWeek** : return the date time at the begin of week of specific date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#BeginOfWeek)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#BeginOfWeek)] [[play](https://go.dev/play/p/ynjoJPz7VNV)] - **BeginOfMonth** : return the date time at the begin of month of specific date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#BeginOfMonth)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#BeginOfMonth)] [[play](https://go.dev/play/p/bWXVFsmmzwL)] - **BeginOfYear** : return the date time at the begin of year of specific date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#BeginOfYear)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#BeginOfYear)] [[play](https://go.dev/play/p/i326DSwLnV8)] - **EndOfMinute** : return the date time at the end of minute of specific date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#EndOfMinute)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#EndOfMinute)] [[play](https://go.dev/play/p/yrL5wGzPj4z)] - **EndOfHour** : return the date time at the end of hour of specific date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#EndOfHour)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#EndOfHour)] [[play](https://go.dev/play/p/6ce3j_6cVqN)] - **EndOfDay** : return the date time at the end of day of specific date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#EndOfDay)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#EndOfDay)] [[play](https://go.dev/play/p/eMBOvmq5Ih1)] - **EndOfWeek** : return the date time at the end of week of specific date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#EndOfWeek)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#EndOfWeek)] [[play](https://go.dev/play/p/i08qKXD9flf)] - **EndOfMonth** : return the date time at the end of month of specific date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#EndOfMonth)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#EndOfMonth)] [[play](https://go.dev/play/p/_GWh10B3Nqi)] - **EndOfYear** : return the date time at the end of year of specific date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#EndOfYear)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#EndOfYear)] [[play](https://go.dev/play/p/G01cKlMCvNm)] - **GetNowDate** : return format yyyy-mm-dd of current date. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#GetNowDate)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#GetNowDate)] [[play](https://go.dev/play/p/PvfkPpcpBBf)] - **GetNowTime** : return format hh-mm-ss of current time. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#GetNowTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#GetNowTime)] [[play](https://go.dev/play/p/l7BNxCkTmJS)] - **GetNowDateTime** : return format yyyy-mm-dd hh-mm-ss of current datetime. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#GetNowDateTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#GetNowDateTime)] [[play](https://go.dev/play/p/pI4AqngD0al)] - **GetTodayStartTime** : return the start time of today, format: yyyy-mm-dd 00:00:00. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#GetTodayStartTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#GetTodayStartTime)] [[play](https://go.dev/play/p/84siyYF7t99)] - **GetTodayEndTime** : return the end time of today, format: yyyy-mm-dd 23:59:59. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#GetTodayEndTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#GetTodayEndTime)] [[play](https://go.dev/play/p/jjrLnfoqgn3)] - **GetZeroHourTimestamp** : return timestamp of zero hour (timestamp of 00:00). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#GetZeroHourTimestamp)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#GetZeroHourTimestamp)] [[play](https://go.dev/play/p/QmL2oIaGE3q)] - **GetNightTimestamp** : return timestamp of zero hour (timestamp of 23:59). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#GetNightTimestamp)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#GetNightTimestamp)] [[play](https://go.dev/play/p/UolysR3MYP1)] - **FormatTimeToStr** : convert time to string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#FormatTimeToStr)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#FormatTimeToStr)] [[play](https://go.dev/play/p/_Ia7M8H_OvE)] - **FormatStrToTime** : convert string to time. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#FormatStrToTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#FormatStrToTime)] [[play](https://go.dev/play/p/1h9FwdU8ql4)] - **NewUnix** : return unix timestamp of specific time. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#NewUnix)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#NewUnix)] [[play](https://go.dev/play/p/psoSuh_kLRt)] - **NewUnixNow** : return unix timestamp of current time. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#NewUnixNow)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#NewUnixNow)] [[play](https://go.dev/play/p/U4PPx-9D0oz)] - **NewFormat** : return unix timestamp of specific time string, t should be "yyyy-mm-dd hh:mm:ss". - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#NewFormat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#NewFormat)] [[play](https://go.dev/play/p/VkW08ZOaXPZ)] - **NewISO8601** : return unix timestamp of specific iso8601 time string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#NewISO8601)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#NewISO8601)] [[play](https://go.dev/play/p/mkhOHQkdeA2)] - **ToUnix** : return unix timestamp. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#ToUnix)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#ToUnix)] [[play](https://go.dev/play/p/_LUiwAdocjy)] - **ToFormat** : return the time string 'yyyy-mm-dd hh:mm:ss' of unix time. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#ToFormat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#ToFormat)] [[play](https://go.dev/play/p/VkW08ZOaXPZ)] - **ToFormatForTpl** : return the time string which format is specific tpl. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#ToFormatForTpl)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#ToFormatForTpl)] [[play](https://go.dev/play/p/nyXxXcQJ8L5)] - **ToIso8601** : return iso8601 time string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#ToIso8601)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#ToIso8601)] [[play](https://go.dev/play/p/mkhOHQkdeA2)] - **IsLeapYear** : check if param `year` is leap year or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#IsLeapYear)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#IsLeapYear)] [[play](https://go.dev/play/p/xS1eS2ejGew)] - **BetweenSeconds** : returns the number of seconds between two times. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#BetweenSeconds)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#BetweenSeconds)] [[play](https://go.dev/play/p/n3YDRyfyXJu)] - **DayOfYear** : returns which day of the year the parameter date `t` is. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#DayOfYear)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#DayOfYear)] [[play](https://go.dev/play/p/0hjqhTwFNlH)] - **IsWeekend** : checks if passed time is weekend or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#IsWeekend)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#IsWeekend)] [[play](https://go.dev/play/p/cupRM5aZOIY)] - **NowDateOrTime** : returns current datetime with specific format and timezone. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#NowDateOrTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#NowDateOrTime)] [[play](https://go.dev/play/p/EZ-begEjtT0)] - **Timestamp** : returns current second timestamp. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#Timestamp)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#Timestamp)] - **TimestampMilli** : returns current mill second timestamp. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#TimestampMilli)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#TimestampMilli)] [[play](https://go.dev/play/p/4gvEusOTu1T)] - **TimestampMicro** : returns current micro second timestamp. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#TimestampMicro)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#TimestampMicro)] [[play](https://go.dev/play/p/2maANglKHQE)] - **TimestampNano** : returns current nano second timestamp. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#TimestampNano)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datetime.md#TimestampNano)] [[play](https://go.dev/play/p/A9Oq_COrcCF)]

8. Datastructure package constains some common data structure. eg. list, linklist, stack, queue, set, tree, graph.        index

@@ -603,23 +603,23 @@ import hashmap "github.com/duke-git/lancet/v2/datastructure/hashmap" #### Structure list: - **List** : a linear table, implemented with slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/list.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datastructure/list.md)] - **CopyOnWriteList** : a thread-safe list implementation that uses go slicing as its base. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/copyonwritelist.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datastructure/copyonwritelist.md)] - **Link** : link list structure, contains singly link and doubly link. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/link.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datastructure/link.md)] - **Stack** : stack structure(fifo), contains array stack and link stack. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/stack.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datastructure/stack.md)] - **Queue** : queue structure(filo), contains array queue, circular queue, link queue and priority queue. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/queue.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datastructure/queue.md)] - **Set** : a data container, like slice, but element of set is not duplicate. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/set.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datastructure/set.md)] - **Tree** : binary search tree structure. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/tree.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datastructure/tree.md)] - **Heap** : a binary max heap. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/heap.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datastructure/heap.md)] - **Hashmap** : hash map structure. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/hashmap.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/datastructure/hashmap.md)]

9. Fileutil package implements some basic functions for file operations.        index

@@ -630,78 +630,78 @@ import "github.com/duke-git/lancet/v2/fileutil" #### Function list: - **ClearFile** : write empty string to target file. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#ClearFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#ClearFile)] [[play](https://go.dev/play/p/NRZ0ZT-G94H)] - **CreateFile** : create file in path. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#CreateFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#CreateFile)] [[play](https://go.dev/play/p/lDt8PEsTNKI)] - **CreateDir** : create directory in absolute path. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#CreateDir)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#CreateDir)] [[play](https://go.dev/play/p/qUuCe1OGQnM)] - **CopyFile** :copy src file to dest file. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#CopyFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#CopyFile)] [[play](https://go.dev/play/p/Jg9AMJMLrJi)] - **FileMode** : return file's mode and permission. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#FileMode)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#FileMode)] [[play](https://go.dev/play/p/2l2hI42fA3p)] - **MiMeType** : return file mime type. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#MiMeType)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#MiMeType)] [[play](https://go.dev/play/p/bd5sevSUZNu)] - **IsExist** : checks if a file or directory exists. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#IsExist)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#IsExist)] [[play](https://go.dev/play/p/nKKXt8ZQbmh)] - **IsLink** : checks if a file is symbol link or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#IsLink)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#IsLink)] [[play](https://go.dev/play/p/TL-b-Kzvf44)] - **IsDir** : checks if the path is directory or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#IsDir)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#IsDir)] [[play](https://go.dev/play/p/WkVwEKqtOWk)] - **ListFileNames** : return all file names in the path. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#ListFileNames)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#ListFileNames)] [[play](https://go.dev/play/p/Tjd7Y07rejl)] - **RemoveFile** : remove file, param should be file path. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#RemoveFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#RemoveFile)] [[play](https://go.dev/play/p/P2y0XW8a1SH)] - **ReadFileToString** : return string of file content. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#ReadFileToString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#ReadFileToString)] [[play](https://go.dev/play/p/cmfwp_5SQTp)] - **ReadFileByLine** : read file line by line, return string slice of file content. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#ReadFileByLine)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#ReadFileByLine)] [[play](https://go.dev/play/p/svJP_7ZrBrD)] - **Zip** : create a zip file of fpath, fpath could be a file or a directory. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#Zip)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#Zip)] [[play](https://go.dev/play/p/j-3sWBp8ik_P)] - **ZipAppendEntry** : append a single file or directory by fpath to an existing zip file. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#ZipAppendEntry)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#ZipAppendEntry)] - **UnZip** : unzip the zip file and save it to dest path. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#UnZip)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#UnZip)] [[play](https://go.dev/play/p/g0w34kS7B8m)] - **CurrentPath** : return current absolute path. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#CurrentPath)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#CurrentPath)] [[play](https://go.dev/play/p/s74a9iBGcSw)] - **IsZipFile** : checks if file is zip file or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#IsZipFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#IsZipFile)] [[play](https://go.dev/play/p/9M0g2j_uF_e)] - **FileSize** : return file size in bytes. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#FileSize)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#FileSize)] [[play](https://go.dev/play/p/H9Z05uD-Jjc)] - **MTime** : return file modified time(unix timestamp). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#MTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#MTime)] [[play](https://go.dev/play/p/s_Tl7lZoAaY)] - **Sha** : return file sha value. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#Sha)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#Sha)] [[play](https://go.dev/play/p/VfEEcO2MJYf)] - **ReadCsvFile** : read file content into slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#ReadCsvFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#ReadCsvFile)] [[play](https://go.dev/play/p/OExTkhGEd3_u)] - **WriteCsvFile** : write content to target csv file. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#WriteCsvFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#WriteCsvFile)] [[play](https://go.dev/play/p/dAXm58Q5U1o)] - **WriteBytesToFile** : write bytes to target file. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#WriteBytesToFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#WriteBytesToFile)] [[play](https://go.dev/play/p/s7QlDxMj3P8)] - **WriteStringToFile** : write string to target file. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil.md#WriteStringToFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/fileutil.md#WriteStringToFile)] [[play](https://go.dev/play/p/GhLS6d8lH_g)]

10. Formatter contains some functions for data formatting.        index

@@ -713,25 +713,25 @@ import "github.com/duke-git/lancet/v2/formatter" #### Function list: - **Comma** : add comma to a number value by every 3 numbers from right, ahead by symbol char. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter.md#Comma)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/formatter.md#Comma)] [[play](https://go.dev/play/p/eRD5k2vzUVX)] - **Pretty** : pretty print data to JSON string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter.md#Pretty)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/formatter.md#Pretty)] [[play](https://go.dev/play/p/YsciGj3FH2x)] - **PrettyToWriter** : pretty encode data to writer. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter.md#PrettyToWriter)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/formatter.md#PrettyToWriter)] [[play](https://go.dev/play/p/LPLZ3lDi5ma)] - **DecimalBytes** : returns a human readable byte size under decimal standard (base 1000). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter.md#DecimalBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/formatter.md#DecimalBytes)] [[play](https://go.dev/play/p/FPXs1suwRcs)] - **BinaryBytes** : returns a human-readable byte size under binary standard (base 1024). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter.md#BinaryBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/formatter.md#BinaryBytes)] [[play](https://go.dev/play/p/G9oHHMCAZxP)] - **ParseDecimalBytes** : return the human readable bytes size string into the amount it represents(base 1000). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter.md#ParseDecimalBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/formatter.md#ParseDecimalBytes)] [[play](https://go.dev/play/p/Am98ybWjvjj)] - **ParseBinaryBytes** : return the human readable bytes size string into the amount it represents(base 1024). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter.md#ParseBinaryBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/formatter.md#ParseBinaryBytes)] [[play](https://go.dev/play/p/69v1tTT62x8)]

11. Function package can control the flow of function execution and support part of functional programming.       index

@@ -743,31 +743,31 @@ import "github.com/duke-git/lancet/v2/function" #### Function list: - **After** : return a function that invokes passed funcation once the returned function is called more than n times. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function.md#After)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/function.md#After)] [[play](https://go.dev/play/p/eRD5k2vzUVX)] - **Before** : return a function that invokes passed funcation once the returned function is called less than n times - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function.md#Before)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/function.md#Before)] [[play](https://go.dev/play/p/0HqUDIFZ3IL)] - **CurryFn** : make a curry function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function.md#CurryFn)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/function.md#CurryFn)] [[play](https://go.dev/play/p/5HopfDwANKX)] - **Compose** : compose the functions from right to left. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function.md#Compose)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/function.md#Compose)] [[play](https://go.dev/play/p/KKfugD4PKYF)] - **Delay** : call the function after delayed time. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function.md#Delay)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/function.md#Delay)] [[play](https://go.dev/play/p/Ivtc2ZE-Tye)] - **Debounced** : creates a debounced function that delays invoking fn until after wait duration have elapsed since the last time the debounced function was invoked. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function.md#Debounced)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/function.md#Debounced)] [[play](https://go.dev/play/p/absuEGB_GN7)] - **Schedule** : invoke function every duration time, util close the returned bool channel. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function.md#Schedule)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/function.md#Schedule)] [[play](https://go.dev/play/p/hbON-Xeyn5N)] - **Pipeline** : takes a list of functions and returns a function whose param will be passed into the functions one by one. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function.md#Pipeline)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/function.md#Pipeline)] [[play](https://go.dev/play/p/mPdUVvj6HD6)] - **Watcher** : Watcher is used for record code excution time. can start/stop/reset the watch timer. get the elapsed time of function execution. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function.md#Watcher)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/function.md#Watcher)] [[play](https://go.dev/play/p/l2yrOpCLd1I)]

12. Maputil package includes some functions to manipulate map.       index

@@ -779,94 +779,94 @@ import "github.com/duke-git/lancet/v2/maputil" #### Function list: - **MapTo** : quick map any value to struct or any base type. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#MapTo)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#MapTo)] [[play](https://go.dev/play/p/4K7KBEPgS5M)] - **ForEach** : executes iteratee funcation for every key and value pair in map. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#ForEach)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#ForEach)] [[play](https://go.dev/play/p/OaThj6iNVXK)] - **Filter** : iterates over map, return a new map contains all key and value pairs pass the predicate function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#Filter)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#Filter)] [[play](https://go.dev/play/p/fSvF3wxuNG7)] - **FilterByKeys** : iterates over map, return a new map whose keys are all given keys - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#FilterByKeys)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#FilterByKeys)] [[play](https://go.dev/play/p/7ov6BJHbVqh)] - **FilterByValues** : iterates over map, return a new map whose values are all given values. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#FilterByValues)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#FilterByValues)] [[play](https://go.dev/play/p/P3-9MdcXegR)] - **OmitBy** : the opposite of Filter, removes all the map elements for which the predicate function returns true. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#OmitBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#OmitBy)] [[play](https://go.dev/play/p/YJM4Hj5hNwm)] - **OmitByKeys** : the opposite of FilterByKeys, extracts all the map elements which keys are not omitted. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#OmitByKeys)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#OmitByKeys)] [[play](https://go.dev/play/p/jXGrWDBfSRp)] - **OmitByValues** : the opposite of FilterByValues. remov all elements whose value are in the give slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#OmitByValues)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#OmitByValues)] [[play](https://go.dev/play/p/XB7Y10uw20_U)] - **Intersect** : iterates over maps, return a new map of key and value pairs in all given maps. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#Intersect)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#Intersect)] [[play](https://go.dev/play/p/Zld0oj3sjcC)] - **Keys** : returns a slice of the map's keys. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#Keys)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#Keys)] [[play](https://go.dev/play/p/xNB5bTb97Wd)] - **KeysBy** : creates a slice whose element is the result of function mapper invoked by every map's key. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#KeysBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#KeysBy)] [[play](https://go.dev/play/p/hI371iB8Up8)] - **Merge** : merge maps, next key will overwrite previous key. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#Merge)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#Merge)] [[play](https://go.dev/play/p/H95LENF1uB-)] - **Minus** : creates a map of whose key in mapA but not in mapB. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#Minus)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#Minus)] [[play](https://go.dev/play/p/3u5U9K7YZ9m)] - **Values** : returns a slice of the map's values. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#Values)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#Values)] [[play](https://go.dev/play/p/CBKdUc5FTW6)] - **ValuesBy** : creates a slice whose element is the result of function mapper invoked by every map's value. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#ValuesBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#ValuesBy)] [[play](https://go.dev/play/p/sg9-oRidh8f)] - **MapKeys** : transforms a map to other type map by manipulating it's keys. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#MapKeys)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#MapKeys)] [[play](https://go.dev/play/p/8scDxWeBDKd)] - **MapValues** : transforms a map to other type map by manipulating it's values. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#MapValues)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#MapValues)] [[play](https://go.dev/play/p/g92aY3fc7Iw)] - **Entries** : transforms a map into array of key/value pairs. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#Entries)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#Entries)] [[play](https://go.dev/play/p/Ltb11LNcElY)] - **FromEntries** : creates a map based on a slice of key/value pairs. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#FromEntries)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#FromEntries)] [[play](https://go.dev/play/p/fTdu4sCNjQO)] - **Transform** : transform a map to another type map. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#Transform)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#Transform)] [[play](https://go.dev/play/p/P6ovfToM3zj)] - **IsDisjoint** : check two map are disjoint if they have no keys in common. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#IsDisjoint)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#IsDisjoint)] [[play](https://go.dev/play/p/N9qgYg_Ho6f)] - **HasKey** : checks if map has key or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#HasKey)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#HasKey)] [[play](https://go.dev/play/p/isZZHOsDhFc)] - **NewConcurrentMap** : creates a ConcurrentMap with specific shard count. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#NewConcurrentMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#NewConcurrentMap)] [[play](https://go.dev/play/p/3PenTPETJT0)] - **ConcurrentMap_Set** : set the value for a key. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#ConcurrentMap_Set)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#ConcurrentMap_Set)] [[play](https://go.dev/play/p/3PenTPETJT0)] - **ConcurrentMap_Get** : get the value stored in the map for a key, or nil if no. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#ConcurrentMap_Get)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#ConcurrentMap_Get)] [[play](https://go.dev/play/p/3PenTPETJT0)] - **ConcurrentMap_GetOrSet** : returns the existing value for the key if present. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#ConcurrentMap_GetOrSet)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#ConcurrentMap_GetOrSet)] [[play](https://go.dev/play/p/aDcDApOK01a)] - **ConcurrentMap_Delete** : delete the value for a key. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#ConcurrentMap_Delete)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#ConcurrentMap_Delete)] [[play](https://go.dev/play/p/uTIJZYhpVMS)] - **ConcurrentMap_GetAndDelete** :returns the existing value for the key if present and then delete the value for the key. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#ConcurrentMap_GetAndDelete)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#ConcurrentMap_GetAndDelete)] [[play](https://go.dev/play/p/ZyxeIXSZUiM)] - **ConcurrentMap_Has** : checks if map has the value for a key. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#ConcurrentMap_Has)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#ConcurrentMap_Has)] [[play](https://go.dev/play/p/C8L4ul9TVwf)] - **ConcurrentMap_Range** : calls iterator sequentially for each key and value present in each of the shards in the map. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil.md#ConcurrentMap_Range)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/maputil.md#ConcurrentMap_Range)] [[play](https://go.dev/play/p/iqcy7P8P0Pr)]

13. Mathutil package implements some functions for math calculation.        index

@@ -878,79 +878,79 @@ import "github.com/duke-git/lancet/v2/mathutil" #### Function list: - **Average** :return average value of numbers. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Average)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Average)] [[play](https://go.dev/play/p/Vv7LBwER-pz)] - **Exponent** : calculate x^n for int64. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Exponent)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Exponent)] [[play](https://go.dev/play/p/uF3HGNPk8wr)] - **Fibonacci** :calculate fibonacci number before n for int. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Fibonacci)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Fibonacci)] [[play](https://go.dev/play/p/IscseUNMuUc)] - **Factorial** : calculate x! for uint. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Factorial)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Factorial)] [[play](https://go.dev/play/p/tt6LdOK67Nx)] - **Max** : return maximum value of numbers. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Max)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Max)] [[play](https://go.dev/play/p/cN8DHI0rTkH)] - **MaxBy** : return the maximum value of a slice using the given comparator function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#MaxBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#MaxBy)] [[play](https://go.dev/play/p/pbe2MT-7DV2)] - **Min** : return minimum value of numbers. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Min)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Min)] [[play](https://go.dev/play/p/21BER_mlGUj)] - **MinBy** : return the minimum value of a slice using the given comparator function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#MinBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#MinBy)] [[play](https://go.dev/play/p/N9qgYg_Ho6f)] - **Percent** : calculate the percentage of value to total. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Percent)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Percent)] [[play](https://go.dev/play/p/s0NdFCtwuyd)] - **RoundToFloat** : round up to n decimal places for float64. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#RoundToFloat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#RoundToFloat)] [[play](https://go.dev/play/p/ghyb528JRJL)] - **RoundToString** : round up to n decimal places for float64, return string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#RoundToString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#RoundToString)] [[play](https://go.dev/play/p/kZwpBRAcllO)] - **TruncRound** : round off n decimal places for int64. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#TruncRound)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#TruncRound)] [[play](https://go.dev/play/p/aumarSHIGzP)] - **Range** : Creates a slice of numbers from start with specified count, element step is 1. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Range)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Range)] [[play](https://go.dev/play/p/9ke2opxa8ZP)] - **RangeWithStep** : Creates a slice of numbers from start to end with specified step. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Range)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Range)] [[play](https://go.dev/play/p/akLWz0EqOSM)] - **AngleToRadian** : converts angle value to radian value. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#AngleToRadian)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#AngleToRadian)] [[play](https://go.dev/play/p/CIvlICqrHql)] - **RadianToAngle** : converts radian value to angle value. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#RadianToAngle)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#RadianToAngle)] [[play](https://go.dev/play/p/dQtmOTUOMgi)] - **PointDistance** : get two points distance. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#PointDistance)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#PointDistance)] [[play](https://go.dev/play/p/RrG4JIaziM8)] - **IsPrime** : checks if number is prime number. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#IsPrime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#IsPrime)] [[play](https://go.dev/play/p/Rdd8UTHZJ7u)] - **GCD** : return greatest common divisor (GCD) of integers. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#GCD)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#GCD)] [[play](https://go.dev/play/p/CiEceLSoAKB)] - **LCM** : return Least Common Multiple (LCM) of integers. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#LCM)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#LCM)] [[play](https://go.dev/play/p/EjcZxfY7G_g)] - **Cos** : return the cosine of the radian argument. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Cos)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Cos)] [[play](https://go.dev/play/p/Sm89LoIfvFq)] - **Sin** : return the sine of the radian argument. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Sin)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Sin)] [[play](https://go.dev/play/p/TWMQlMywDsP)] - **Log** : returns the logarithm of base n. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Log)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Log)] [[play](https://go.dev/play/p/_d4bi8oyhat)] - **Sum** : return sum of passed numbers. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Sum)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Sum)] [[play](https://go.dev/play/p/1To2ImAMJA7)] - **Abs** : returns the absolute value of param nubmer. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil.md#Sum)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/mathutil.md#Sum)] [[play](https://go.dev/play/p/fsyBh1Os-1d)]

14. Netutil package contains functions to get net information and send http request.        index

@@ -962,68 +962,68 @@ import "github.com/duke-git/lancet/v2/netutil" #### Function list: - **ConvertMapToQueryString** : convert map to sorted url query string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#ConvertMapToQueryString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#ConvertMapToQueryString)] [[play](https://go.dev/play/p/jnNt_qoSnRi)] - **EncodeUrl** : encode url(?a=1&b=[2] -> ?a=1&b=%5B2%5D). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#EncodeUrl)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#EncodeUrl)] [[play](https://go.dev/play/p/bsZ6BRC4uKI)] - **GetInternalIp** : return internal ipv4. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#GetInternalIp)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#GetInternalIp)] [[play](https://go.dev/play/p/5mbu-gFp7ei)] - **GetIps** : return all ipv4 of current system. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#GetIps)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#GetIps)] [[play](https://go.dev/play/p/NUFfcEmukx1)] - **GetMacAddrs** : return mac address of current system. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#GetMacAddrs)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#GetMacAddrs)] [[play](https://go.dev/play/p/Rq9UUBS_Xp1)] - **GetPublicIpInfo** : return [public ip information](http://ip-api.com/json/). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#GetPublicIpInfo)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#GetPublicIpInfo)] [[play](https://go.dev/play/p/YDxIfozsRHR)] - **GetRequestPublicIp** : return the http request public ip. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#GetRequestPublicIp)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#GetRequestPublicIp)] [[play](https://go.dev/play/p/kxU-YDc_eBo)] - **IsPublicIP** : verify a ip is public or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#IsPublicIP)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#IsPublicIP)] [[play](https://go.dev/play/p/nmktSQpJZnn)] - **IsInternalIP** : verify an ip is intranet or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#IsInternalIP)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#IsInternalIP)] [[play](https://go.dev/play/p/sYGhXbgO4Cb)] - **HttpRequest** : a composed http request used for HttpClient send request. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#HttpRequest)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#HttpRequest)] [[play](https://go.dev/play/p/jUSgynekH7G)] - **HttpClient** : a http client tool, used for sending http request - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#HttpClient)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#HttpClient)] [[play](https://go.dev/play/p/jUSgynekH7G)] - **SendRequest** : send http request. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#SendRequest)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#SendRequest)] [[play](https://go.dev/play/p/jUSgynekH7G)] - **DecodeResponse** : decode http response into target object. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#DecodeResponse)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#DecodeResponse)] [[play](https://go.dev/play/p/jUSgynekH7G)] - **StructToUrlValues** : convert struct to url valuse. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#StructToUrlValues)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#StructToUrlValues)] [[play](https://go.dev/play/p/pFqMkM40w9z)] - **HttpGetdeprecated** : send http get request. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#HttpGet)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#HttpGet)] - **HttpDeletedeprecated** : send http delete request. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#HttpDelete)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#HttpDelete)] - **HttpPostdeprecated** : send http post request. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#HttpPost)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#HttpPost)] - **HttpPutdeprecated** : send http put request. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#HttpPut)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#HttpPut)] - **HttpPatchdeprecated** : send http patch request. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#HttpPatch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#HttpPatch)] - **ParseHttpResponse** : decode http response into target object. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#ParseHttpResponse)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#ParseHttpResponse)] - **DownloadFile** : download the file exist in url to a local file. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#DownloadFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#DownloadFile)] - **UploadFile** : upload the file to a server. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#UploadFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#UploadFile)] - **IsPingConnected** : checks if can ping the specified host or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#IsPingConnected)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#IsPingConnected)] [[play](https://go.dev/play/p/q8OzTijsA87)] - **IsTelnetConnected** : checks if can if can telnet the specified host or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil.md#IsTelnetConnected)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/netutil.md#IsTelnetConnected)] [[play](https://go.dev/play/p/yiLCGtQv_ZG)]

15. Pointer package contains some util functions to operate go pointer.        index

@@ -1035,19 +1035,19 @@ import "github.com/duke-git/lancet/v2/pointer" #### Function list: - **ExtractPointer** : return the underlying value by the given interface type. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/pointer.md#ExtractPointer)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/pointer.md#ExtractPointer)] [[play](https://go.dev/play/p/D7HFjeWU2ZP)] - **Of** : return a pointer to the value `v`. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/pointer.md#Of)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/pointer.md#Of)] [[play](https://go.dev/play/p/HFd70x4DrMj)] - **Unwrap** : return the value from the pointer. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/pointer.md#Unwrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/pointer.md#Unwrap)] [[play](https://go.dev/play/p/cgeu3g7cjWb)] - **UnwarpOr** : UnwarpOr returns the value from the pointer or fallback if the pointer is nil. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/pointer.md#UnwrapOr)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/pointer.md#UnwrapOr)] [[play](https://go.dev/play/p/mmNaLC38W8C)] - **UnwarpOrDefault** : UnwarpOrDefault returns the value from the pointer or the default value if the pointer is nil. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/pointer.md#UnwrapOrDefault)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/pointer.md#UnwrapOrDefault)] [[play](https://go.dev/play/p/ZnGIHf8_o4E)]

16. Random package implements some basic functions to generate random int and string.        index

@@ -1059,31 +1059,31 @@ import "github.com/duke-git/lancet/v2/random" #### Function list: - **RandBytes** : generate random byte slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random.md#RandBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/random.md#RandBytes)] [[play](https://go.dev/play/p/EkiLESeXf8d)] - **RandInt** : generate random int number between min and max. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random.md#RandInt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/random.md#RandInt)] [[play](https://go.dev/play/p/pXyyAAI5YxD)] - **RandString** : generate random string of specific length. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random.md#RandString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/random.md#RandString)] [[play](https://go.dev/play/p/W2xvRUXA7Mi)] - **RandUpper** : generate a random upper case string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random.md#RandUpper)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/random.md#RandUpper)] [[play](https://go.dev/play/p/29QfOh0DVuh)] - **RandLower** : generate a random lower case string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random.md#RandLower)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/random.md#RandLower)] [[play](https://go.dev/play/p/XJtZ471cmtI)] - **RandNumeral** : generate a random numeral string of specific length. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random.md#RandNumeral)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/random.md#RandNumeral)] [[play](https://go.dev/play/p/g4JWVpHsJcf)] - **RandNumeralOrLetter** : generate a random numeral or letter string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random.md#RandNumeralOrLetter)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/random.md#RandNumeralOrLetter)] [[play](https://go.dev/play/p/19CEQvpx2jD)] - **UUIdV4** : generate a random UUID of version 4 according to RFC 4122. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random.md#UUIdV4)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/random.md#UUIdV4)] [[play](https://go.dev/play/p/_Z9SFmr28ft)] - **RandUniqueIntSlice** : generate a slice of random int of length n that do not repeat. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random.md#RandUniqueIntSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/random.md#RandUniqueIntSlice)] [[play](https://go.dev/play/p/uBkRSOz73Ec)]

17. Retry package is for executing a function repeatedly until it was successful or canceled by the context.        index

@@ -1095,19 +1095,19 @@ import "github.com/duke-git/lancet/v2/retry" #### Function list: - **Context** : set retry context config option. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/retry.md#Context)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/retry.md#Context)] [[play](https://go.dev/play/p/xnAOOXv9GkS)] - **Retry** : executes the retryFunc repeatedly until it was successful or canceled by the context. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/retry.md#Retry)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/retry.md#Retry)] [[play](https://go.dev/play/p/nk2XRmagfVF)] - **RetryFunc** : function that retry executes. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/retry.md#RetryFunc)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/retry.md#RetryFunc)] [[play](https://go.dev/play/p/nk2XRmagfVF)] - **RetryDuration** : set duration of retry - [[doc](https://github.com/duke-git/lancet/blob/main/docs/retry.md#RetryDuration)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/retry.md#RetryDuration)] [[play](https://go.dev/play/p/nk2XRmagfVF)] - **RetryTimes** : set times of retry. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/retry.md#RetryTimes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/retry.md#RetryTimes)] [[play](https://go.dev/play/p/ssfVeU2SwLO)]

18. Slice contains some functions to manipulate slice.        index

@@ -1119,211 +1119,211 @@ import "github.com/duke-git/lancet/v2/slice" #### Function list: - **AppendIfAbsent** : if the item is absent,append it to the slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#AppendIfAbsent)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#AppendIfAbsent)] [[play](https://go.dev/play/p/GNdv7Jg2Taj)] - **Contain** : check if the value is in the slice or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Contain)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Contain)] [[play](https://go.dev/play/p/_454yEHcNjf)] - **ContainBy** : returns true if predicate function return true. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#ContainBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#ContainBy)] [[play](https://go.dev/play/p/49tkHfX4GNc)] - **ContainSubSlice** : check if the slice contain a given subslice or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#ContainSubSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#ContainSubSlice)] [[play](https://go.dev/play/p/bcuQ3UT6Sev)] - **Chunk** : creates a slice of elements split into groups the length of size. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Chunk)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Chunk)] [[play](https://go.dev/play/p/b4Pou5j2L_C)] - **Compact** : creates an slice with all falsey values removed. The values false, nil, 0, and "" are falsey. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Compact)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Compact)] [[play](https://go.dev/play/p/pO5AnxEr3TK)] - **Concat** : creates a new slice concatenating slice with any additional slices. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Concat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Concat)] [[play](https://go.dev/play/p/gPt-q7zr5mk)] - **Count** : returns the number of occurrences of the given item in the slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Count)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Count)] [[play](https://go.dev/play/p/Mj4oiEnQvRJ)] - **CountBy** : iterates over elements of slice with predicate function, returns the number of all matched elements. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#CountBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#CountBy)] [[play](https://go.dev/play/p/tHOccTMDZCC)] - **Difference** : creates an slice of whose element in slice but not in compared slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Difference)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Difference)] [[play](https://go.dev/play/p/VXvadzLzhDa)] - **DifferenceBy** : accepts iteratee which is invoked for each element of slice and values to generate the criterion by which they're compared. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#DifferenceBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#DifferenceBy)] [[play](https://go.dev/play/p/DiivgwM5OnC)] - **DifferenceWith** : accepts comparator which is invoked to compare elements of slice to values. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#DifferenceWith)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#DifferenceWith)] [[play](https://go.dev/play/p/v2U2deugKuV)] - **DeleteAt** : delete the element of slice from specific start index to end index - 1. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#DeleteAt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#DeleteAt)] [[play](https://go.dev/play/p/pJ-d6MUWcvK)] - **Drop** : drop n elements from the start of a slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Drop)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Drop)] [[play](https://go.dev/play/p/jnPO2yQsT8H)] - **DropRight** : drop n elements from the end of a slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#DropRight)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#DropRight)] [[play](https://go.dev/play/p/8bcXvywZezG)] - **DropWhile** : drop n elements from the start of a slice while predicate function returns true. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#DropWhile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#DropWhile)] [[play](https://go.dev/play/p/4rt252UV_qs)] - **DropRightWhile** : drop n elements from the end of a slice while predicate function returns true. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#DropRightWhile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#DropRightWhile)] [[play](https://go.dev/play/p/6wyK3zMY56e)] - **Equal** : checks if two slices are equal: the same length and all elements' order and value are equal. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Equal)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Equal)] [[play](https://go.dev/play/p/WcRQJ37ifPa)] - **EqualWith** : checks if two slices are equal with comparator func. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#EqualWith)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#EqualWith)] [[play](https://go.dev/play/p/b9iygtgsHI1)] - **Every** : return true if all of the values in the slice pass the predicate function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Every)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Every)] [[play](https://go.dev/play/p/R8U6Sl-j8cD)] - **Filter** : iterates over elements of slice, returning an slice of all elements pass the predicate function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Filter)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Filter)] [[play](https://go.dev/play/p/SdPna-7qK4T)] - **FilterMap** : returns a slice which apply both filtering and mapping to the given slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#FilterMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#FilterMap)] [[play](https://go.dev/play/p/J94SZ_9MiIe)] - **Finddeprecated** : iterates over elements of slice, returning the first one that passes a truth test on predicate function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Find)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Find)] [[play](https://go.dev/play/p/CBKeBoHVLgq)] - **FindBy** : iterates over elements of slice, returning the first one that passes a truth test on predicate function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#FindBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#FindBy)] [[play](https://go.dev/play/p/n1lysBYl-GB)] - **FindLastdeprecated** : return the last item that passes a truth test on predicate function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#FindLast)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#FindLast)] [[play](https://go.dev/play/p/FFDPV_j7URd)] - **FindLastBy** : iterates over elements of slice, returning the last one that passes a truth test on predicate function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#FindLastBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#FindLastBy)] [[play](https://go.dev/play/p/8iqomzyCl_s)] - **Flatten** : flattens slice one level. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Flatten)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Flatten)] [[play](https://go.dev/play/p/hYa3cBEevtm)] - **FlattenDeep** : flattens slice recursive to one level. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#FlattenDeep)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#FlattenDeep)] [[play](https://go.dev/play/p/yjYNHPyCFaF)] - **FlatMap** : manipulates a slice and transforms and flattens it to a slice of another type. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#FlatMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#FlatMap)] [[play](https://go.dev/play/p/_QARWlWs1N_F)] - **ForEach** : iterates over elements of slice and invokes function for each element. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#ForEach)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#ForEach)] [[play](https://go.dev/play/p/DrPaa4YsHRF)] - **ForEachWithBreak** : iterates over elements of slice and invokes function for each element, when iteratee return false, will break the for each loop. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#ForEachWithBreak)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#ForEachWithBreak)] [[play](https://go.dev/play/p/qScs39f3D9W)] - **GroupBy** : iterate over elements of the slice, each element will be group by criteria, returns two slices. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#GroupBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#GroupBy)] [[play](https://go.dev/play/p/QVkPxzPR0iA)] - **GroupWith** : return a map composed of keys generated from the resultults of running each element of slice thru iteratee. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#GroupWith)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#GroupWith)] [[play](https://go.dev/play/p/ApCvMNTLO8a)] - **IntSlicedeprecated** : convert param to int slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#IntSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#IntSlice)] [[play](https://go.dev/play/p/FdQXF0Vvqs-)] - **InterfaceSlicedeprecated** : convert param to interface slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#InterfaceSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#InterfaceSlice)] [[play](https://go.dev/play/p/FdQXF0Vvqs-)] - **Intersection** : creates a slice of unique elements that included by all slices. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Intersection)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Intersection)] [[play](https://go.dev/play/p/anJXfB5wq_t)] - **InsertAt** : insert the value or other slice into slice at index. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#InsertAt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#InsertAt)] [[play](https://go.dev/play/p/hMLNxPEGJVE)] - **IndexOf** : returns the index at which the first occurrence of an item is found in a slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#IndexOf)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#IndexOf)] [[play](https://go.dev/play/p/MRN1f0FpABb)] - **LastIndexOf** : returns the index at which the last occurrence of the item is found in a slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#LastIndexOf)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#LastIndexOf)] [[play](https://go.dev/play/p/DokM4cf1IKH)] - **Map** : creates an slice of values by running each element of slice thru iteratee function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Map)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Map)] [[play](https://go.dev/play/p/biaTefqPquw)] - **Merge** : merge all given slices into one slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Merge)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Merge)] [[play](https://go.dev/play/p/lbjFp784r9N)] - **Reverse** : return slice of element order is reversed to the given slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Reverse)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Reverse)] [[play](https://go.dev/play/p/8uI8f1lwNrQ)] - **Reducedeprecated** : creates an slice of values by running each element of slice thru iteratee function.(Deprecated: use ReduceBy) - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Reduce)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Reduce)] [[play](https://go.dev/play/p/_RfXJJWIsIm)] - **ReduceBy** : produces a value from slice by accumulating the result of each element as passed through the reducer function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#ReduceBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#ReduceBy)] [[play](https://go.dev/play/p/YKDpLi7gtee)] - **ReduceRight** : ReduceRight is like ReduceBy, but it iterates over elements of slice from right to left. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#ReduceRight)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#ReduceRight)] [[play](https://go.dev/play/p/qT9dZC03A1K)] - **Replace** : returns a copy of the slice with the first n non-overlapping instances of old replaced by new. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Replace)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Replace)] [[play](https://go.dev/play/p/P5mZp7IhOFo)] - **ReplaceAll** : returns a copy of the slice with all non-overlapping instances of old replaced by new. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#ReplaceAll)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#ReplaceAll)] [[play](https://go.dev/play/p/CzqXMsuYUrx)] - **Repeat** : creates a slice with length n whose elements are passed item. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Repeat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Repeat)] [[play](https://go.dev/play/p/1CbOmtgILUU)] - **Shuffle** : shuffle the slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Shuffle)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Shuffle)] [[play](https://go.dev/play/p/YHvhnWGU3Ge)] - **IsAscending** : Checks if a slice is ascending order. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#IsAscending)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#IsAscending)] [[play](https://go.dev/play/p/9CtsFjet4SH)] - **IsDescending** : Checks if a slice is descending order. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#IsDescending)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#IsDescending)] [[play](https://go.dev/play/p/U_LljFXma14)] - **IsSorted** : Checks if a slice is sorted (ascending or descending). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#IsSorted)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#IsSorted)] [[play](https://go.dev/play/p/nCE8wPLwSA-)] - **IsSortedByKey** : Checks if a slice is sorted by iteratee function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#IsSortedByKey)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#IsSortedByKey)] [[play](https://go.dev/play/p/tUoGB7DOHI4)] - **Sort** : sorts a slice of any ordered type(number or string). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Sort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Sort)] [[play](https://go.dev/play/p/V9AVjzf_4Fk)] - **SortBy** : sorts the slice in ascending order as determined by the less function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#SortBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#SortBy)] [[play](https://go.dev/play/p/DAhLQSZEumm)] - **SortByFielddeprecated** : return sorted slice by specific field. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#SortByField)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#SortByField)] [[play](https://go.dev/play/p/fU1prOBP9p1)] - **Some** : return true if any of the values in the list pass the predicate function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Some)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Some)] [[play](https://go.dev/play/p/4pO9Xf9NDGS)] - **StringSlicedeprecated** : convert param to slice of string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#StringSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#StringSlice)] [[play](https://go.dev/play/p/W0TZDWCPFcI)] - **SymmetricDifference** : the symmetric difference of two slice, also known as the disjunctive union. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#h42nJX5xMln)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#h42nJX5xMln)] [[play](https://go.dev/play/p/1CbOmtgILUU)] - **ToSlice** : returns a slices of a variable parameter transformation. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#ToSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#ToSlice)] [[play](https://go.dev/play/p/YzbzVq5kscN)] - **ToSlicePointer** : returns a pointer to the slices of a variable parameter transformation. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#ToSlicePointer)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#ToSlicePointer)] [[play](https://go.dev/play/p/gx4tr6_VXSF)] - **Unique** : remove duplicate elements in slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Unique)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Unique)] [[play](https://go.dev/play/p/AXw0R3ZTE6a)] - **UniqueBy** : call iteratee func with every item of slice, then remove duplicated. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#UniqueBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#UniqueBy)] [[play](https://go.dev/play/p/UR323iZLDpv)] - **Union** : creates a slice of unique elements, in order, from all given slices. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Union)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Union)] [[play](https://go.dev/play/p/hfXV1iRIZOf)] - **UnionBy** : accepts iteratee which is invoked for each element of each slice, then union slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#UnionBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#UnionBy)] [[play](https://go.dev/play/p/HGKHfxKQsFi)] - **UpdateAt** : update the slice element at index. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#UpdateAt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#UpdateAt)] [[play](https://go.dev/play/p/f3mh2KloWVm)] - **Without** : creates a slice excluding all given items. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Without)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Without)] [[play](https://go.dev/play/p/bwhEXEypThg)] - **KeyBy** : converts a slice to a map based on a callback function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#KeyBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#KeyBy)] [[play](https://go.dev/play/p/uXod2LWD1Kg)] - **Join** : join the slice item with specify separator. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#Join)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/slice.md#Join)] [[play](https://go.dev/play/p/huKzqwNDD7V)]

19. Stream package implements a sequence of elements supporting sequential and operations. this package is an experiment to explore if stream in go can work as the way java does. its function is very limited.        index

@@ -1335,82 +1335,82 @@ import "github.com/duke-git/lancet/v2/stream" #### Function list: - **Of** : creates a stream whose elements are the specified values. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Of)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Of)] [[play](https://go.dev/play/p/jI6_iZZuVFE)] - **FromSlice** : creates a stream from slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#FromSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#FromSlice)] [[play](https://go.dev/play/p/wywTO0XZtI4)] - **FromChannel** : creates a stream from channel. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#FromChannel)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#FromChannel)] [[play](https://go.dev/play/p/9TZYugGMhXZ)] - **FromRange** : creates a number stream from start to end. both start and end are included. [start, end] - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#FromRange)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#FromRange)] [[play](https://go.dev/play/p/9Ex1-zcg-B-)] - **Generate** : creates a stream where each element is generated by the provided generater function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Generate)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Generate)] [[play](https://go.dev/play/p/rkOWL1yA3j9)] - **Concat** : creates a lazily concatenated stream whose elements are all the elements of the first stream followed by all the elements of the second stream. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Concat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Concat)] [[play](https://go.dev/play/p/HM4OlYk_OUC)] - **Distinct** : creates returns a stream that removes the duplicated items. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Distinct)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Distinct)] [[play](https://go.dev/play/p/eGkOSrm64cB)] - **Filter** : returns a stream consisting of the elements of this stream that match the given predicate. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Filter)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Filter)] [[play](https://go.dev/play/p/MFlSANo-buc)] - **Map** : returns a stream consisting of the elements of this stream that apply the given function to elements of stream. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Map)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Map)] [[play](https://go.dev/play/p/OtNQUImdYko)] - **Peek** : returns a stream consisting of the elements of this stream, additionally performing the provided action on each element as elements are consumed from the resulting stream. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Peek)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Peek)] [[play](https://go.dev/play/p/u1VNzHs6cb2)] - **Skip** : returns a stream consisting of the remaining elements of this stream after discarding the first n elements of the stream. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Skip)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Skip)] [[play](https://go.dev/play/p/fNdHbqjahum)] - **Limit** : returns a stream consisting of the elements of this stream, truncated to be no longer than maxSize in length. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Limit)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Limit)] [[play](https://go.dev/play/p/qsO4aniDcGf)] - **Reverse** : returns a stream whose elements are reverse order of given stream. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Reverse)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Reverse)] [[play](https://go.dev/play/p/A8_zkJnLHm4)] - **Range** : returns a stream whose elements are in the range from start(included) to end(excluded) original stream. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Range)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Range)] [[play](https://go.dev/play/p/indZY5V2f4j)] - **Sorted** : returns a stream consisting of the elements of this stream, sorted according to the provided less function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Sorted)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Sorted)] [[play](https://go.dev/play/p/XXtng5uonFj)] - **ForEach** : performs an action for each element of this stream. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#ForEach)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#ForEach)] [[play](https://go.dev/play/p/Dsm0fPqcidk)] - **Reduce** : performs a reduction on the elements of this stream, using an associative accumulation function, and returns an Optional describing the reduced value, if any. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Reduce)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Reduce)] [[play](https://go.dev/play/p/6uzZjq_DJLU)] - **FindFirst** : returns the first element of this stream and true, or zero value and false if the stream is empty. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#FindFirst)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#FindFirst)] [[play](https://go.dev/play/p/9xEf0-6C1e3)] - **FindLast** : returns the last element of this stream and true, or zero value and false if the stream is empty. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#FindLast)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#FindLast)] [[play](https://go.dev/play/p/WZD2rDAW-2h)] - **Max** : returns the maximum element of this stream according to the provided less function. less fuction: a > b - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Max)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Max)] [[play](https://go.dev/play/p/fm-1KOPtGzn)] - **Min** : returns the minimum element of this stream according to the provided less function. less fuction: a < b - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Min)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Min)] [[play](https://go.dev/play/p/vZfIDgGNRe_0)] - **AllMatch** : returns whether all elements of this stream match the provided predicate. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#AllMatch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#AllMatch)] [[play](https://go.dev/play/p/V5TBpVRs-Cx)] - **AnyMatch** : returns whether any elements of this stream match the provided predicate. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#AnyMatch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#AnyMatch)] [[play](https://go.dev/play/p/PTCnWn4OxSn)] - **NoneMatch** : returns whether no elements of this stream match the provided predicate. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#NoneMatch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#NoneMatch)] [[play](https://go.dev/play/p/iWS64pL1oo3)] - **Count** : returns the count of elements in the stream. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Count)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#Count)] [[play](https://go.dev/play/p/r3koY6y_Xo-)] - **ToSlice** : returns the elements in the stream. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#ToSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/stream.md#ToSlice)] [[play](https://go.dev/play/p/jI6_iZZuVFE)]

20. Structs package provides several high level functions to manipulate struct, tag, and field.        index

@@ -1422,29 +1422,29 @@ import "github.com/duke-git/lancet/v2/structs" #### Function list: - **New** : creates a `Struct` instance. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/struct.md#New)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/structs/struct.md#New)] - **ToMap** : converts a valid struct to a map. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/struct.md#ToMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/structs/struct.md#ToMap)] - **Fields** : get all fields of a given struct, that the fields are abstract struct field. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/struct.md#Fields)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/structs/struct.md#Fields)] - **IsStruct** : check if the struct is valid. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/struct.md#IsStruct)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/structs/struct.md#IsStruct)] - **Tag** : get a `Tag` of the `Field`, `Tag` is a abstract struct field tag - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field.md#Tag)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/structs/field.md#Tag)] - **Name** : get the field name. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field.md#Name)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/structs/field.md#Name)] - **Value** : get the `Field` underlying value. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field.md#Value)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/structs/field.md#Value)] - **Kind** : get the field's kind - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field.md#Kind)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/structs/field.md#Kind)] - **IsEmbedded** : check if the field is an embedded field. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field.md#IsEmbedded)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/structs/field.md#IsEmbedded)] - **IsExported** : check if the field is exporte - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field.md#IsExported)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/structs/field.md#IsExported)] - **IsZero** : check if the field is zero value - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field.md#IsZero)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/structs/field.md#IsZero)] - **IsSlice** : check if the field is a slice - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field.md#IsSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/structs/field.md#IsSlice)]

21. Strutil package contains some functions to manipulate string.        index

@@ -1455,114 +1455,114 @@ import "github.com/duke-git/lancet/v2/strutil" #### Function list: - **After** : returns the substring after the first occurrence of a specific string in the source string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#After)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#After)] [[play](https://go.dev/play/p/RbCOQqCDA7m)] -- **AfterLast** : returns the substring after the last occurrence of a specific string in the source string. [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#AfterLast)] +- **AfterLast** : returns the substring after the last occurrence of a specific string in the source string. [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#AfterLast)] [[play](https://go.dev/play/p/1TegARrb8Yn)] - **Before** : returns the substring before the first occurrence of a specific string in the source string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#Before)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#Before)] [[play](https://go.dev/play/p/JAWTZDS4F5w)] - **BeforeLast** : returns the substring before the last occurrence of a specific string in the source string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#BeforeLast)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#BeforeLast)] [[play](https://go.dev/play/p/pJfXXAoG_Te)] - **CamelCase** : coverts source string to its camelCase string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#CamelCase)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#CamelCase)] [[play](https://go.dev/play/p/9eXP3tn2tUy)] - **Capitalize** : converts the first character of source string to upper case and the remaining to lower case. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#Capitalize)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#Capitalize)] [[play](https://go.dev/play/p/2OAjgbmAqHZ)] - **ContainsAll** : return true if target string contains all the substrings. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#ContainsAll)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#ContainsAll)] [[play](https://go.dev/play/p/KECtK2Os4zq)] - **ContainsAny** : return true if target string contains any one of the substrings. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#ContainsAny)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#ContainsAny)] [[play](https://go.dev/play/p/dZGSSMB3LXE)] - **IsString** : checks if the parameter value data type is string or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#IsString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#IsString)] [[play](https://go.dev/play/p/IOgq7oF9ERm)] - **KebabCase** : coverts string to kebab-case string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#KebabCase)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#KebabCase)] [[play](https://go.dev/play/p/dcZM9Oahw-Y)] - **UpperKebabCase** : coverts string to upper KEBAB-CASE string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#UpperKebabCase)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#UpperKebabCase)] [[play](https://go.dev/play/p/zDyKNneyQXk)] - **LowerFirst** : converts the first character of string to lower case. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#LowerFirst)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#LowerFirst)] [[play](https://go.dev/play/p/CbzAyZmtJwL)] - **UpperFirst** : converts the first character of string to upper case. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#UpperFirst)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#UpperFirst)] [[play](https://go.dev/play/p/sBbBxRbs8MM)] - **Pad** : pads string on the left and right side if it's shorter than size. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#Pad)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#Pad)] [[play](https://go.dev/play/p/NzImQq-VF8q)] - **PadEnd** : pads string with given characters on the right side if it's shorter than limit size. Padding characters are truncated if they exceed size. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#PadEnd)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#PadEnd)] [[play](https://go.dev/play/p/9xP8rN0vz--)] - **PadStart** : pads string with given characters on the left side if it's shorter than limit size. Padding characters are truncated if they exceed size. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#PadStart)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#PadStart)] [[play](https://go.dev/play/p/xpTfzArDfvT)] - **Reverse** : returns string whose char order is reversed to the given string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#Reverse)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#Reverse)] [[play](https://go.dev/play/p/adfwalJiecD)] - **SnakeCase** : coverts string to snake_case string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#SnakeCase)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#SnakeCase)] [[play](https://go.dev/play/p/tgzQG11qBuN)] - **UpperSnakeCase** : coverts string to upper SNAKE_CASE string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#UpperSnakeCase)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#UpperSnakeCase)] [[play](https://go.dev/play/p/4COPHpnLx38)] - **SplitEx** : split a given string which can control the result slice contains empty string or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#SplitEx)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#SplitEx)] [[play](https://go.dev/play/p/Us-ySSbWh-3)] - **Substring** : returns a substring of the specific length starting at the specific offset position. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#Substring)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#Substring)] [[play](https://go.dev/play/p/q3sM6ehnPDp)] - **Wrap** : wrap a string with given string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#Wrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#Wrap)] [[play](https://go.dev/play/p/KoZOlZDDt9y)] - **Unwrap** : unwrap a given string from anther string. will change source string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#Unwrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#Unwrap)] [[play](https://go.dev/play/p/Ec2q4BzCpG-)] - **SplitWords** : splits a string into words, word only contains alphabetic characters. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#SplitWords)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#SplitWords)] [[play](https://go.dev/play/p/KLiX4WiysMM)] - **WordCount** : return the number of meaningful word of a string, word only contains alphabetic characters. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#WordCount)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#WordCount)] [[play](https://go.dev/play/p/bj7_odx3vRf)] - **RemoveNonPrintable** : remove non-printable characters from a string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#RemoveNonPrintable)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#RemoveNonPrintable)] [[play](https://go.dev/play/p/og47F5x_jTZ)] - **StringToBytes** : converts a string to byte slice without a memory allocation. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#StringToBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#StringToBytes)] [[play](https://go.dev/play/p/7OyFBrf9AxA)] - **BytesToString** : converts a byte slice to string without a memory allocation. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#BytesToString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#BytesToString)] [[play](https://go.dev/play/p/6c68HRvJecH)] - **IsBlank** : checks if a string is whitespace or empty. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#IsBlank)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#IsBlank)] [[play](https://go.dev/play/p/6zXRH_c0Qd3)] - **HasPrefixAny** : checks if a string starts with any of an array of specified strings. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#HasPrefixAny)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#HasPrefixAny)] [[play](https://go.dev/play/p/8UUTl2C5slo)] - **HasSuffixAny** : checks if a string ends with any of an array of specified strings. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#HasSuffixAny)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#HasSuffixAny)] [[play](https://go.dev/play/p/sKWpCQdOVkx)] - **IndexOffset** : returns the index of the first instance of substr in string after offsetting the string by `idxFrom`. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#IndexOffset)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#IndexOffset)] [[play](https://go.dev/play/p/qZo4lV2fomB)] - **ReplaceWithMap** : returns a copy of `str`, which is replaced by a map in unordered way, case-sensitively. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#ReplaceWithMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#ReplaceWithMap)] [[play](https://go.dev/play/p/h3t7CNj2Vvu)] - **Trim** : strips whitespace (or other characters) from the beginning and end of a string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#Trim)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#Trim)] [[play](https://go.dev/play/p/Y0ilP0NRV3j)] - **SplitAndTrim** : splits string `str` by a string `delimiter` to a slice, and calls Trim to every element of slice. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#SplitAndTrim)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#SplitAndTrim)] [[play](https://go.dev/play/p/ZNL6o4SkYQ7)] - **HideString** : Hide some chars in source string with param `replaceChar`. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#HideString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#HideString)] [[play](https://go.dev/play/p/pzbaIVCTreZ)] - **RemoveWhiteSpace** : remove whitespace characters from a string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#RemoveWhiteSpace)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/strutil.md#RemoveWhiteSpace)] [[play](https://go.dev/play/p/HzLC9vsTwkf)] @@ -1575,31 +1575,31 @@ import "github.com/duke-git/lancet/v2/system" #### Function list: - **IsWindows** : check if current os is windows. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system.md#IsWindows)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/system.md#IsWindows)] [[play](https://go.dev/play/p/XzJULbzmf9m)] - **IsLinux** : check if current os is linux. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system.md#IsLinux)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/system.md#IsLinux)] [[play](https://go.dev/play/p/zIflQgZNuxD)] - **IsMac** : check if current os is macos. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system.md#IsMac)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/system.md#IsMac)] [[play](https://go.dev/play/p/Mg4Hjtyq7Zc)] - **GetOsEnv** : get the value of the environment variable named by the key. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system.md#GetOsEnv)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/system.md#GetOsEnv)] [[play](https://go.dev/play/p/D88OYVCyjO-)] - **SetOsEnv** : set the value of the environment variable named by the key. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system.md#SetOsEnv)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/system.md#SetOsEnv)] [[play](https://go.dev/play/p/D88OYVCyjO-)] - **RemoveOsEnv** : remove a single environment variable. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system.md#RemoveOsEnv)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/system.md#RemoveOsEnv)] [[play](https://go.dev/play/p/fqyq4b3xUFQ)] - **CompareOsEnv** : get env named by the key and compare it with passed env. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system.md#CompareOsEnv)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/system.md#CompareOsEnv)] [[play](https://go.dev/play/p/BciHrKYOHbp)] - **ExecCommand** : execute command, return the stdout and stderr string of command, and error if error occurs. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system.md#ExecCommand)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/system.md#ExecCommand)] [[play](https://go.dev/play/p/n-2fLyZef-4)] - **GetOsBits** : return current os bits (32 or 64). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system.md#GetOsBits)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/system.md#GetOsBits)] [[play](https://go.dev/play/p/ml-_XH3gJbW)]

23. Tuple package implements tuple data type and some operations on it.        index

@@ -1611,112 +1611,112 @@ import "github.com/duke-git/lancet/v2/tuple" #### Function list: - **Tuple2** : represents a 2 elemnets tuple. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple2)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple2)] [[play](https://go.dev/play/p/3sHVqBQpLYN)] - **Tuple2_Unbox** : returns values in Tuple2. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple2_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple2_Unbox)] [[play](https://go.dev/play/p/0fD1qfCVwjm)] - **Zip2** : create a slice of Tuple2, whose elements are correspond to the given slice elements. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Zip2)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Zip2)] [[play](https://go.dev/play/p/4ncWJJ77Xio)] - **Unzip2** : create a group of slice from a slice of Tuple2. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Unzip2)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Unzip2)] [[play](https://go.dev/play/p/KBecr60feXb)] - **Tuple3** : represents a 3 elemnets tuple. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple3)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple3)] [[play](https://go.dev/play/p/FtH2sdCLlCf)] - **Tuple3_Unbox** : returns values in Tuple3. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple3_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple3_Unbox)] [[play](https://go.dev/play/p/YojLy-id1BS)] - **Zip3** : create a slice of Tuple3, whose elements are correspond to the given slice elements. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Zip3)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Zip3)] [[play](https://go.dev/play/p/97NgmsTILfu)] - **Unzip3** : create a group of slice from a slice of Tuple3. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Unzip3)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Unzip3)] [[play](https://go.dev/play/p/bba4cpAa7KO)] - **Tuple4** : represents a 4 elemnets tuple. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple4)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple4)] [[play](https://go.dev/play/p/D2EqDz096tk)] - **Tuple4_Unbox** : returns values in Tuple4. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple4_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple4_Unbox)] [[play](https://go.dev/play/p/ACj9YuACGgW)] - **Zip4** : create a slice of Tuple4, whose elements are correspond to the given slice elements. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Zip4)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Zip4)] [[play](https://go.dev/play/p/PEmTYVK5hL4)] - **Unzip4** : create a group of slice from a slice of Tuple4. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Unzip4)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Unzip4)] [[play](https://go.dev/play/p/rb8z4gyYSRN)] - **Tuple5** : represents a 5 elemnets tuple. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple5)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple5)] [[play](https://go.dev/play/p/2WndmVxPg-r)] - **Tuple5_Unbox** : returns values in Tuple4. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple5_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple5_Unbox)] [[play](https://go.dev/play/p/GyIyZHjCvoS)] - **Zip5** : create a slice of Tuple5, whose elements are correspond to the given slice elements. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Zip5)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Zip5)] [[play](https://go.dev/play/p/fCAAJLMfBIP)] - **Unzip5** : create a group of slice from a slice of Tuple5. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Unzip5)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Unzip5)] [[play](https://go.dev/play/p/gyl6vKfhqPb)] - **Tuple6** : represents a 6 elemnets tuple. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple6)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple6)] [[play](https://go.dev/play/p/VjqcCwEJZbs)] - **Tuple6_Unbox** : returns values in Tuple6. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple6_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple6_Unbox)] [[play](https://go.dev/play/p/FjIHV7lpxmW)] - **Zip6** : create a slice of Tuple6, whose elements are correspond to the given slice elements. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Zip6)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Zip6)] [[play](https://go.dev/play/p/oWPrnUYuFHo)] - **Unzip6** : create a group of slice from a slice of Tuple6. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Unzip6)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Unzip6)] [[play](https://go.dev/play/p/l41XFqCyh5E)] - **Tuple7** : represents a 7 elemnets tuple. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple7)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple7)] [[play](https://go.dev/play/p/dzAgv_Ezub9)] - **Tuple7_Unbox** : returns values in Tuple7. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple7_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple7_Unbox)] [[play](https://go.dev/play/p/R9I8qeDk0zs)] - **Zip7** : create a slice of Tuple7, whose elements are correspond to the given slice elements. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Zip7)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Zip7)] [[play](https://go.dev/play/p/WUJuo897Egf)] - **Unzip7** : create a group of slice from a slice of Tuple7. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Unzip7)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Unzip7)] [[play](https://go.dev/play/p/hws_P1Fr2j3)] - **Tuple8** : represents a 8 elemnets tuple. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple8)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple8)] [[play](https://go.dev/play/p/YA9S0rz3dRz)] - **Tuple8_Unbox** : returns values in Tuple8. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple8_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple8_Unbox)] [[play](https://go.dev/play/p/PRxLBBb4SMl)] - **Zip8** : create a slice of Tuple8, whose elements are correspond to the given slice elements. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Zip8)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Zip8)] [[play](https://go.dev/play/p/8V9jWkuJfaQ)] - **Unzip8** : create a group of slice from a slice of Tuple8. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Unzip8)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Unzip8)] [[play](https://go.dev/play/p/1SndOwGsZB4)] - **Tuple9** : represents a 9 elemnets tuple. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple9)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple9)] [[play](https://go.dev/play/p/yS2NGGtZpQr)] - **Tuple9_Unbox** : returns values in Tuple9. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple9_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple9_Unbox)] [[play](https://go.dev/play/p/oFJFGTAuOa8)] - **Zip9** : create a slice of Tuple9, whose elements are correspond to the given slice elements. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Zip9)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Zip9)] [[play](https://go.dev/play/p/cgsL15QYnfz)] - **Unzip9** : create a group of slice from a slice of Tuple9. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Unzip9)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Unzip9)] [[play](https://go.dev/play/p/91-BU_KURSA)] - **Tuple10** : represents a 10 elemnets tuple. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple10)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple10)] [[play](https://go.dev/play/p/799qqZg0hUv)] - **Tuple10_Unbox** : returns values in Tuple10. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Tuple10_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Tuple10_Unbox)] [[play](https://go.dev/play/p/qfyx3x_X0Cu)] - **Zip10** : create a slice of Tuple10, whose elements are correspond to the given slice elements. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Zip10)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Zip10)] [[play](https://go.dev/play/p/YSR-2cXnrY4)] - **Unzip10** : create a group of slice from a slice of Tuple10. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple.md#Unzip10)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/tuple.md#Unzip10)] [[play](https://go.dev/play/p/-taQB6Wfre_z)]

24. Validator package contains some functions for data validation.        index

@@ -1728,103 +1728,103 @@ import "github.com/duke-git/lancet/v2/validator" #### Function list: - **ContainChinese** : check if the string contain mandarin chinese. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#ContainChinese)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#ContainChinese)] [[play](https://go.dev/play/p/7DpU0uElYeM)] - **ContainLetter** : check if the string contain at least one letter. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#ContainLetter)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#ContainLetter)] [[play](https://go.dev/play/p/lqFD04Yyewp)] - **ContainLower** : check if the string contain at least one lower case letter a-z. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#ContainLower)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#ContainLower)] [[play](https://go.dev/play/p/Srqi1ItvnAA)] - **ContainUpper** : check if the string contain at least one upper case letter A-Z. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#ContainUpper)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#ContainUpper)] [[play](https://go.dev/play/p/CmWeBEk27-z)] - **IsAlpha** : checks if the string contains only letters (a-zA-Z). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsAlpha)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsAlpha)] [[play](https://go.dev/play/p/7Q5sGOz2izQ)] - **IsAllUpper** : check if the string is all upper case letters A-Z. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsAllUpper)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsAllUpper)] [[play](https://go.dev/play/p/ZHctgeK1n4Z)] - **IsAllLower** : check if the string is all lower case letters a-z. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsAllLower)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsAllLower)] [[play](https://go.dev/play/p/GjqCnOfV6cM)] - **IsBase64** : check if the string is base64 string. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsBase64)] [[play](https://go.dev/play/p/sWHEySAt6hl)] - **IsChineseMobile** : check if the string is chinese mobile number. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsChineseMobile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsChineseMobile)] [[play](https://go.dev/play/p/GPYUlGTOqe3)] - **IsChineseIdNum** : check if the string is chinese id card. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsChineseIdNum)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsChineseIdNum)] [[play](https://go.dev/play/p/d8EWhl2UGDF)] - **IsChinesePhone** : check if the string is chinese phone number.(xxx-xxxxxxxx or xxxx-xxxxxxx.) - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsChinesePhone)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsChinesePhone)] [[play](https://go.dev/play/p/RUD_-7YZJ3I)] - **IsCreditCard** : check if the string is credit card. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsCreditCard)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsCreditCard)] [[play](https://go.dev/play/p/sNwwL6B0-v4)] - **IsDns** : check if the string is dns. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsDns)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsDns)] [[play](https://go.dev/play/p/jlYApVLLGTZ)] - **IsEmail** : check if the string is a email address. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsEmail)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsEmail)] [[play](https://go.dev/play/p/Os9VaFlT33G)] - **IsEmptyString** : check if the string is empty. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsEmptyString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsEmptyString)] [[play](https://go.dev/play/p/dpzgUjFnBCX)] - **IsFloat** : check if the value is float(float32, float34) or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsFloat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsFloat)] [[play](https://go.dev/play/p/vsyG-sxr99_Z)] - **IsFloatStr** : check if the string can convert to a float. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsFloatStr)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsFloatStr)] [[play](https://go.dev/play/p/LOYwS_Oyl7U)] - **IsNumber** : check if the value is number(integer, float) or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsNumber)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsNumber)] [[play](https://go.dev/play/p/mdJHOAvtsvF)] - **IsNumberStr** : check if the string can convert to a number. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsNumberStr)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsNumberStr)] [[play](https://go.dev/play/p/LzaKocSV79u)] - **IsJSON** : check if the string is valid JSON. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsJSON)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsJSON)] [[play](https://go.dev/play/p/8Kip1Itjiil)] - **IsRegexMatch** : check if the string match the regexp. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsRegexMatch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsRegexMatch)] [[play](https://go.dev/play/p/z_XeZo_litG)] - **IsInt** : check if the string can convert to a number. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsInt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsInt)] [[play](https://go.dev/play/p/eFoIHbgzl-z)] - **IsIntStr** : check if the string can convert to a integer. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsIntStr)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsIntStr)] [[play](https://go.dev/play/p/jQRtFv-a0Rk)] - **IsIp** : check if the string is ip. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsIp)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsIp)] [[play](https://go.dev/play/p/FgcplDvmxoD)] - **IsIpV4** : check if the string is ipv4. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsIpV4)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsIpV4)] [[play](https://go.dev/play/p/zBGT99EjaIu)] - **IsIpV6** : check if the string is ipv6. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsIpV6)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsIpV6)] [[play](https://go.dev/play/p/AHA0r0AzIdC)] - **IsStrongPassword** : check if the string is strong password. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsStrongPassword)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsStrongPassword)] [[play](https://go.dev/play/p/QHdVcSQ3uDg)] - **IsUrl** : check if the string is url. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsUrl)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsUrl)] [[play](https://go.dev/play/p/pbJGa7F98Ka)] - **IsWeakPassword** : check if the string is weak password. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsWeakPassword)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsWeakPassword)] [[play](https://go.dev/play/p/wqakscZH5gH)] - **IsZeroValue** : check if value is a zero value. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsZeroValue)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsZeroValue)] [[play](https://go.dev/play/p/UMrwaDCi_t4)] - **IsGBK** : check if data encoding is gbk. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsGBK)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsGBK)] [[play](https://go.dev/play/p/E2nt3unlmzP)] - **IsASCII** : checks if string is all ASCII char. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsASCII)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsASCII)] [[play](https://go.dev/play/p/hfQNPLX0jNa)] - **IsPrintable** : checks if string is all printable chars. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsPrintable)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/validator.md#IsPrintable)] [[play](https://go.dev/play/p/Pe1FE2gdtTP)]

25. Xerror package implements helpers for errors.        index

@@ -1836,43 +1836,43 @@ import "github.com/duke-git/lancet/v2/xerror" #### Function list: - **New** : creates a new XError pointer instance with message. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#New)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#New)] [[play](https://go.dev/play/p/w4oWZts7q7f)] - **Wrap** : creates a new XError pointer instance based on error object, and add message. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#Wrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#Wrap)] [[play](https://go.dev/play/p/5385qT2dCi4)] - **Unwrap** : returns unwrapped XError from err by errors.As. If no XError, returns nil. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#Unwrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#Unwrap)] [[play](https://go.dev/play/p/LKMLep723tu)] - **XError_Wrap** : creates a new XError and copy message and id to new one. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#XError_Wrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#XError_Wrap)] [[play](https://go.dev/play/p/RpjJ5u5sc97)] - **XError_Unwrap** : Compatible with github.com/pkg/errors. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#XError_Unwrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#XError_Unwrap)] [[play](https://go.dev/play/p/VUXJ8BST4c6)] - **XError_With** : adds key and value related to the XError object. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#XError_With)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#XError_With)] [[play](https://go.dev/play/p/ow8UISXX_Dp)] - **XError_Id** : sets XError object id to check equality in XError.Is. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#XError_Id)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#XError_Id)] [[play](https://go.dev/play/p/X6HBlsy58U9)] - **XError_Is** : checks if target error is XError and Error.id of two errors are matched. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#XError_Is)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#XError_Is)] [[play](https://go.dev/play/p/X6HBlsy58U9)] - **XError_Values** : returns map of key and value that is set by XError.With function. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#XError_Values)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#XError_Values)] [[play](https://go.dev/play/p/ow8UISXX_Dp)] - **XError_StackTrace** : returns stack trace which is compatible with pkg/errors. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#XError_StackTrace)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#XError_StackTrace)] [[play](https://go.dev/play/p/6FAvSQpa7pc)] - **XError_Info** : returns information of xerror, which can be printed. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#XError_Info)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#XError_Info)] [[play](https://go.dev/play/p/1ZX0ME1F-Jb)] - **XError_Error** : implements standard error interface. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#XError_Error)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#XError_Error)] [[play](https://go.dev/play/p/w4oWZts7q7f)] - **TryUnwrap** : check if err is nil then it returns a valid value. If err is not nil, TryUnwrap panics with err. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror.md#TryUnwrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/en/api/packages/xerror.md#TryUnwrap)] [[play](https://go.dev/play/p/acyZVkNZEeW)] ## How to Contribute diff --git a/README_zh-CN.md b/README_zh-CN.md index b560ee3..3d2610d 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -109,40 +109,40 @@ import "github.com/duke-git/lancet/v2/algorithm" #### 函数列表: - **BubbleSort** : 使用冒泡排序算法对切片进行排序。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm_zh-CN.md#BubbleSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/algorithm.md#BubbleSort)] [[play](https://go.dev/play/p/GNdv7Jg2Taj)] - **CountSort** : 使用计数排序算法对切片进行排序。不改变原数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm_zh-CN.md#CountSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/algorithm.md#CountSort)] [[play](https://go.dev/play/p/tB-Umgm0DrP)] - **HeapSort** : 使用堆排序算法对切片进行排序。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm_zh-CN.md#HeapSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/algorithm.md#HeapSort)] [[play](https://go.dev/play/p/u6Iwa1VZS_f)] - **InsertionSort** : 使用插入排序算法对切片进行排序。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm_zh-CN.md#InsertionSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/algorithm.md#InsertionSort)] [[play](https://go.dev/play/p/G5LJiWgJJW6)] - **MergeSort** : 使用合并排序算法对切片进行排序。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm_zh-CN.md#MergeSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/algorithm.md#MergeSort)] [[play](https://go.dev/play/p/ydinn9YzUJn)] - **QuickSort** : 使用快速排序算法对切片进行排序。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm_zh-CN.md#QuickSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/algorithm.md#QuickSort)] [[play](https://go.dev/play/p/7Y7c1Elk3ax)] - **SelectionSort** : 使用选择排序算法对切片进行排序。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm_zh-CN.md#SelectionSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/algorithm.md#SelectionSort)] [[play](https://go.dev/play/p/oXovbkekayS)] - **ShellSort** : 使用希尔排序算法对切片进行排序。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm_zh-CN.md#ShellSort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/algorithm.md#ShellSort)] [[play](https://go.dev/play/p/3ibkszpJEu3)] - **BinarySearch** : 返回排序切片中目标值的索引,使用二分搜索(递归调用)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm_zh-CN.md#BinarySearch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/algorithm.md#BinarySearch)] [[play](https://go.dev/play/p/t6MeGiUSN47)] - **BinaryIterativeSearch** :返回排序切片中目标值的索引,使用二分搜索(非递归)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm_zh-CN.md#BinaryIterativeSearch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/algorithm.md#BinaryIterativeSearch)] [[play](https://go.dev/play/p/Anozfr8ZLH3)] - **LinearSearch** : 基于传入的相等函数返回切片中目标值的索引。(线性查找) - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm_zh-CN.md#LinearSearch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/algorithm.md#LinearSearch)] [[play](https://go.dev/play/p/IsS7rgn5s3x)] - **LRUCache** : 应用 lru 算法实现内存缓存. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/algorithm_zh-CN.md#LRUCache)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/algorithm.md#LRUCache)] [[play](https://go.dev/play/p/-EZjgOURufP)]

2. compare 包提供几个轻量级的类型比较函数。       回到目录

@@ -154,25 +154,25 @@ import "github.com/duke-git/lancet/v2/compare" #### 函数列表: - **Equal** : 检查两个值是否相等(检查类型和值)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare_zh-CN.md#Equal)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/compare.md#Equal)] [[play](https://go.dev/play/p/wmVxR-to4lz)] - **EqualValue** : 检查两个值是否相等(只检查值)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare_zh-CN.md#EqualValue)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/compare.md#EqualValue)] [[play](https://go.dev/play/p/fxnna_LLD9u)] - **LessThan** : 验证参数`left`的值是否小于参数`right`的值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare_zh-CN.md#LessThan)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/compare.md#LessThan)] [[play](https://go.dev/play/p/cYh7FQQj0ne)] - **GreaterThan** : 验证参数`left`的值是否大于参数`right`的值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare_zh-CN.md#GreaterThan)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/compare.md#GreaterThan)] [[play](https://go.dev/play/p/9-NYDFZmIMp)] - **LessOrEqual** : 验证参数`left`的值是否小于或等于参数`right`的值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare_zh-CN.md#LessOrEqual)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/compare.md#LessOrEqual)] [[play](https://go.dev/play/p/e4T_scwoQzp)] - **GreaterOrEqual** : 验证参数`left`的值是否大于或等于参数`right`的值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare_zh-CN.md#GreaterOrEqual)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/compare.md#GreaterOrEqual)] [[play](https://go.dev/play/p/vx8mP0U8DFk)] - **InDelta** : 检查增量内两个值是否相等。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/compare_zh-CN.md#InDelta)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/compare.md#InDelta)]

3. concurrency 包含一些支持并发编程的功能。例如:goroutine, channel, async 等。       回到目录

@@ -183,34 +183,34 @@ import "github.com/duke-git/lancet/v2/concurrency" #### 函数列表: - **NewChannel** : 返回一个 Channel 指针实例。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency_zh-CN.md#NewChannel)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/concurrency.md#NewChannel)] [[play](https://go.dev/play/p/7aB4KyMMp9A)] - **Bridge** : 将多个 channel 链接到一个 channel,直到取消上下文。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/Bridge.md#NewChannel)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/Bridge.md#NewChannel)] [[play](https://go.dev/play/p/qmWSy1NVF-Y)] - **FanIn** : 将多个 channel 合并为一个 channel,直到取消上下文。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency_zh-CN.md#FanIn)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/concurrency.md#FanIn)] [[play](https://go.dev/play/p/2VYFMexEvTm)] - **Generate** : 根据传入的值,生成 channel。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency_zh-CN.md#Generate)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/concurrency.md#Generate)] [[play](https://go.dev/play/p/7aB4KyMMp9A)] - **Or** : 将一个或多个 channel 读取到一个 channel 中,当任何读取 channel 关闭时将结束读取。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency_zh-CN.md#Or)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/concurrency.md#Or)] [[play](https://go.dev/play/p/Wqz9rwioPww)] - **OrDone** : 将一个 channel 读入另一个 channel,直到取消上下文。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency_zh-CN.md#OrDone)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/concurrency.md#OrDone)] [[play](https://go.dev/play/p/lm_GoS6aDjo)] - **Repeat** : 返回一个 channel,将参数`values`重复放入 channel,直到取消上下文。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency_zh-CN.md#Repeat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/concurrency.md#Repeat)] [[play](https://go.dev/play/p/k5N_ALVmYjE)] - **RepeatFn** : 返回一个 channel,重复执行函数 fn,并将结果放入返回的 channel,直到取消上下文。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency_zh-CN.md#RepeatFn)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/concurrency.md#RepeatFn)] [[play](https://go.dev/play/p/4J1zAWttP85)] - **Take** : 返回一个 channel,其值从另一个 channel 获取,直到取消上下文。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency_zh-CN.md#Take)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/concurrency.md#Take)] [[play](https://go.dev/play/p/9Utt-1pDr2J)] - **Tee** : 将一个 channel 分成两个 channel,直到取消上下文。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/concurrency_zh-CN.md#Tee)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/concurrency.md#Tee)] [[play](https://go.dev/play/p/3TQPKnCirrP)]

4. condition 包含一些用于条件判断的函数。       回到目录

@@ -222,28 +222,28 @@ import "github.com/duke-git/lancet/v2/condition" #### 函数列表: - **Bool** : 返回传入参数的 bool 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition_zh-CN.md#Bool)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/condition.md#Bool)] [[play](https://go.dev/play/p/ETzeDJRSvhm)] - **And** : 逻辑且操作,当切仅当 a 和 b 都为 true 时返回 true。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition_zh-CN.md#And)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/condition.md#And)] [[play](https://go.dev/play/p/W1SSUmt6pvr)] - **Or** : 逻辑或操作,当切仅当 a 和 b 都为 false 时返回 false。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition_zh-CN.md#Or)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/condition.md#Or)] [[play](https://go.dev/play/p/UlQTxHaeEkq)] - **Xor** : 逻辑异或操作,a 和 b 相同返回 false,a 和 b 不相同返回 true - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition_zh-CN.md#Xor)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/condition.md#Xor)] [[play](https://go.dev/play/p/gObZrW7ZbG8)] - **Nor** : 异或的取反操作。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition_zh-CN.md#Nor)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/condition.md#Nor)] [[play](https://go.dev/play/p/g2j08F_zZky)] - **Xnor** : 如果 a 和 b 都是真的或 a 和 b 均是假的,则返回 true。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition_zh-CN.md#Xnor)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/condition.md#Xnor)] [[play](https://go.dev/play/p/OuDB9g51643)] - **Nand** : 如果 a 和 b 都为真,返回 false,否则返回 true - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition_zh-CN.md#Nand)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/condition.md#Nand)] [[play](https://go.dev/play/p/vSRMLxLIbq8)] - **TernaryOperator** : 三元运算符。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/condition_zh-CN.md#TernaryOperator)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/condition.md#TernaryOperator)] [[play](https://go.dev/play/p/ElllPZY0guT)]

5. convertor 转换器包支持一些常见的数据类型转换。       回到目录

@@ -255,67 +255,67 @@ import "github.com/duke-git/lancet/v2/convertor" #### 函数列表: - **ColorHexToRGB** : 颜色值十六进制转 rgb。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ColorHexToRGB)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ColorHexToRGB)] [[play](https://go.dev/play/p/o7_ft-JCJBV)] - **ColorRGBToHex** : 颜色值 rgb 转十六进制。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ColorRGBToHex)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ColorRGBToHex)] [[play](https://go.dev/play/p/nzKS2Ro87J1)] - **ToBool** : 字符串转布尔类型,使用 strconv.ParseBool。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ToBool)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToBool)] [[play](https://go.dev/play/p/ARht2WnGdIN)] - **ToBytes** : interface 转字节切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ToBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToBytes)] [[play](https://go.dev/play/p/fAMXYFDvOvr)] - **ToChar** : 字符串转字符切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ToChar)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToChar)] [[play](https://go.dev/play/p/JJ1SvbFkVdM)] - **ToChannel** : 将切片转为只读 channel。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ToChannel)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToChannel)] [[play](https://go.dev/play/p/hOx_oYZbAnL)] - **ToFloat** : 将 interface 转成 float64 类型,如果参数无法转换,会返回 0.0 和 error。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ToFloat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToFloat)] [[play](https://go.dev/play/p/4YTmPCibqHJ)] - **ToInt** : 将 interface 转成 int64 类型,如果参数无法转换,会返回 0 和 error。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ToInt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToInt)] [[play](https://go.dev/play/p/9_h9vIt-QZ_b)] - **ToJson** : 将 interface 转成 json 字符串,如果参数无法转换,会返回""和 error。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ToJson)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToJson)] [[play](https://go.dev/play/p/2rLIkMmXWvR)] - **ToMap** : 将切片转为 map。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ToMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToMap)] [[play](https://go.dev/play/p/tVFy7E-t24l)] - **ToPointer** : 返回传入值的指针。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ToPointer)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToPointer)] [[play](https://go.dev/play/p/ASf_etHNlw1)] - **ToString** : 将值转换为字符串,对于数字、字符串、[]byte,将转换为字符串。 对于其他类型(切片、映射、数组、结构)将调用 json.Marshal。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ToString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToString)] [[play](https://go.dev/play/p/nF1zOOslpQq)] - **StructToMap** : 将 struct 转成 map,只会转换 struct 中可导出的字段。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#StructToMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#StructToMap)] [[play](https://go.dev/play/p/KYGYJqNUBOI)] - **MapToSlice** : map 中 key 和 value 执行函数 iteratee 后,转为切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#MapToSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#MapToSlice)] [[play](https://go.dev/play/p/dmX4Ix5V6Wl)] - **EncodeByte** : 将传入的 data 编码成字节切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#EncodeByte)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#EncodeByte)] [[play](https://go.dev/play/p/DVmM1G5JfuP)] - **DecodeByte** : 解码字节切片到目标对象,目标对象需要传入一个指针实例。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#DecodeByte)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#DecodeByte)] [[play](https://go.dev/play/p/zI6xsmuQRbn)] - **DeepClone** : 创建一个传入值的深拷贝, 无法克隆结构体的非导出字段。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#DeepClone)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#DeepClone)] [[play](https://go.dev/play/p/j4DP5dquxnk)] - **CopyProperties** : 拷贝不同结构体之间的同名字段。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#CopyProperties)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#CopyProperties)] [[play](https://go.dev/play/p/oZujoB5Sgg5)] - **ToInterface** : 将反射值转换成对应的 interface 类型。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#ToInterface)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#ToInterface)] [[play](https://go.dev/play/p/syqw0-WG7Xd)] - **Utf8ToGbk** : utf8 编码转 GBK 编码。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#Utf8ToGbk)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#Utf8ToGbk)] [[play](https://go.dev/play/p/9FlIaFLArIL)] - **GbkToUtf8** : GBK 编码转 utf8 编码。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/convertor_zh-CN.md#GbkToUtf8)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/convertor.md#GbkToUtf8)] [[play](https://go.dev/play/p/OphmHCN_9u8)]

6. cryptor 加密包支持数据加密和解密,获取 md5,hash 值。支持 base64, md5, hmac, aes, des, rsa。       回到目录

@@ -327,129 +327,129 @@ import "github.com/duke-git/lancet/v2/cryptor" #### 函数列表: - **AesEcbEncrypt** : 使用 AES ECB 算法模式加密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#AesEcbEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#AesEcbEncrypt)] [[play](https://go.dev/play/p/zI6xsmuQRbn)] - **AesEcbDecrypt** : 使用 AES ECB 算法模解密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#AesEcbDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#AesEcbDecrypt)] [[play](https://go.dev/play/p/zI6xsmuQRbn)] - **AesCbcEncrypt** : 使用 AES CBC 算法模式加密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#AesCbcEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#AesCbcEncrypt)] [[play](https://go.dev/play/p/IOq_g8_lKZD)] - **AesCbcDecrypt** : 使用 AES CBC 算法模式解密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#AesCbcDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#AesCbcDecrypt)] [[play](https://go.dev/play/p/IOq_g8_lKZD)] - **AesCtrCrypt** : 使用 AES CTR 算法模式加密/解密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#AesCtrCrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#AesCtrCrypt)] [[play](https://go.dev/play/p/SpaZO0-5Nsp)] - **AesCfbEncrypt** : 使用 AES CFB 算法模式加密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#AesCfbEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#AesCfbEncrypt)] [[play](https://go.dev/play/p/tfkF10B13kH)] - **AesCfbDecrypt** : 使用 AES CFB 算法模式解密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#AesCfbDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#AesCfbDecrypt)] [[play](https://go.dev/play/p/tfkF10B13kH)] - **AesOfbEncrypt** : 使用 AES OFB 算法模式加密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#AesOfbEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#AesOfbEncrypt)] [[play](https://go.dev/play/p/VtHxtkUj-3F)] - **AesOfbDecrypt** : 使用 AES OFB 算法模式解密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#AesOfbDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#AesOfbDecrypt)] [[play](https://go.dev/play/p/VtHxtkUj-3F)] - **Base64StdEncode** : 将字符串 base64 编码。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Base64StdEncode)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Base64StdEncode)] [[play](https://go.dev/play/p/VOaUyQUreoK)] - **Base64StdDecode** : 解码 base64 字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Base64StdDecode)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Base64StdDecode)] [[play](https://go.dev/play/p/RWQylnJVgIe)] - **DesEcbEncrypt** : 使用 DES ECB 算法模式加密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#DesEcbEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#DesEcbEncrypt)] [[play](https://go.dev/play/p/8qivmPeZy4P)] - **DesEcbDecrypt** : 使用 DES ECB 算法模解密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#DesEcbDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#DesEcbDecrypt)] [[play](https://go.dev/play/p/8qivmPeZy4P)] - **DesCbcEncrypt** : 使用 DES CBC 算法模式加密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#DesCbcEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#DesCbcEncrypt)] [[play](https://go.dev/play/p/4cC4QvWfe3_1)] - **DesCbcDecrypt** : 使用 DES CBC 算法模式解密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#DesCbcDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#DesCbcDecrypt)] [[play](https://go.dev/play/p/4cC4QvWfe3_1)] - **DesCtrCrypt** : 使用 DES CTR 算法模式加密/解密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#DesCtrCrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#DesCtrCrypt)] [[play](https://go.dev/play/p/9-T6OjKpcdw)] - **DesCfbEncrypt** : 使用 DES CFB 算法模式加密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#DesCfbEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#DesCfbEncrypt)] [[play](https://go.dev/play/p/y-eNxcFBlxL)] - **DesCfbDecrypt** : 使用 DES CFB 算法模式解密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#DesCfbDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#DesCfbDecrypt)] [[play](https://go.dev/play/p/y-eNxcFBlxL)] - **DesOfbEncrypt** : 使用 DES OFB 算法模式加密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#DesOfbEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#DesOfbEncrypt)] [[play](https://go.dev/play/p/74KmNadjN1J)] - **DesOfbDecrypt** : 使用 DES OFB 算法模式解密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#DesOfbDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#DesOfbDecrypt)] [[play](https://go.dev/play/p/74KmNadjN1J)] - **HmacMd5** : 返回字符串 md5 hmac 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#HmacMd5)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#HmacMd5)] [[play](https://go.dev/play/p/uef0q1fz53I)] - **HmacMd5WithBase64** : 获取字符串 md5 hmac base64 字符串值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#HmacMd5WithBase64)] - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor.md#HmacMd5WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#HmacMd5WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#HmacMd5WithBase64)] - **HmacSha1** : 返回字符串 sha1 hmac 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#HmacSha1)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#HmacSha1)] [[play](https://go.dev/play/p/1UI4oQ4WXKM)] - **HmacSha1WithBase64** : 获取字符串的 sha1 base64 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#HmacSha1WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#HmacSha1WithBase64)] [[play](https://go.dev/play/p/47JmmGrnF7B)] - **HmacSha256** : 返回字符串 sha256 hmac 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#HmacSha256)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#HmacSha256)] [[play](https://go.dev/play/p/HhpwXxFhhC0)] - **HmacSha256WithBase64** : 获取字符串 sha256 hmac base64 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#HmacSha256WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#HmacSha256WithBase64)] [[play](https://go.dev/play/p/EKbkUvPTLwO)] - **HmacSha512** : 返回字符串 sha256 hmac 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#HmacSha512)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#HmacSha512)] [[play](https://go.dev/play/p/59Od6m4A0Ud)] - **HmacSha512WithBase64** : 获取字符串 sha512 hmac base64 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#HmacSha512WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#HmacSha512WithBase64)] [[play](https://go.dev/play/p/c6dSe3E2ydU)] - **Md5Byte** : 返回 byte slice 的 md5 值. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Md5Byte)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Md5Byte)] [[play](https://go.dev/play/p/suraalH8lyC)] - **Md5ByteWithBase64** : 获取 byte slice 的 md5 base64 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Md5ByteWithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Md5ByteWithBase64)] [[play](https://go.dev/play/p/Tcb-Z7LN2ax)] - **Md5String** : 返回字符串 md5 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Md5String)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Md5String)] [[play](https://go.dev/play/p/1bLcVetbTOI)] - **Md5StringWithBase64** : 获取字符串 md5 base64 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Md5StringWithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Md5StringWithBase64)] [[play](https://go.dev/play/p/Lx4gH7Vdr5_y)] - **Md5File** : 返回文件 md5 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Md5File)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Md5File)] - **Sha1** : 返回字符串 sha1 哈希值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Sha1)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Sha1)] [[play](https://go.dev/play/p/_m_uoD1deMT)] - **Sha1WithBase64** : 获取字符串 sha1 base64 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Sha1WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Sha1WithBase64)] [[play](https://go.dev/play/p/fSyx-Gl2l2-)] - **Sha256** :返回字符串 sha256 哈希值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Sha256)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Sha256)] [[play](https://go.dev/play/p/tU9tfBMIAr1)] - **Sha256WithBase64** : 获取字符串 sha256 base64 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Sha256WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Sha256WithBase64)] [[play](https://go.dev/play/p/85IXJHIal1k)] - **Sha512** : 返回字符串 sha512 哈希值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Sha512)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Sha512)] [[play](https://go.dev/play/p/3WsvLYZxsHa)] - **Sha512WithBase64** : 获取字符串 sha512 base64 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#Sha512WithBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#Sha512WithBase64)] [[play](https://go.dev/play/p/q_fY2rA-k5I)] - **GenerateRsaKey** : 在当前目录下创建 rsa 私钥文件和公钥文件。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#GenerateRsaKey)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#GenerateRsaKey)] [[play](https://go.dev/play/p/zutRHrDqs0X)] - **RsaEncrypt** : 用公钥文件 ras 加密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#RsaEncrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#RsaEncrypt)] [[play](https://go.dev/play/p/uef0q1fz53I)] - **RsaDecrypt** : 用私钥文件 rsa 解密数据。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/cryptor_zh-CN.md#RsaDecrypt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/cryptor.md#RsaDecrypt)] [[play](https://go.dev/play/p/uef0q1fz53I)]

7. datetime 日期时间处理包,格式化日期,比较日期。       回到目录

@@ -461,133 +461,133 @@ import "github.com/duke-git/lancet/v2/datetime" #### 函数列表: - **AddDay** : 将日期加/减天数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#AddDay)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#AddDay)] [[play](https://go.dev/play/p/dIGbs_uTdFa)] - **AddHour** : 将日期加/减小时数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#AddHour)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#AddHour)] [[play](https://go.dev/play/p/rcMjd7OCsi5)] - **AddMinute** : 将日期加/减分钟数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#AddMinute)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#AddMinute)] [[play](https://go.dev/play/p/nT1heB1KUUK)] - **AddYear** : 将日期加/减分年数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#AddYear)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#AddYear)] [[play](https://go.dev/play/p/MqW2ujnBx10)] - **BeginOfMinute** : 返回指定时间的分钟开始时间。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#BeginOfMinute)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#BeginOfMinute)] [[play](https://go.dev/play/p/ieOLVJ9CiFT)] - **BeginOfHour** : 返回指定时间的小时开始时间。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#BeginOfHour)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#BeginOfHour)] [[play](https://go.dev/play/p/GhdGFnDWpYs)] - **BeginOfDay** : 返回指定时间的当天开始时间。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#BeginOfDay)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#BeginOfDay)] [[play](https://go.dev/play/p/94m_UT6cWs9)] - **BeginOfWeek** : 返回指定时间的每周开始时间,默认开始时间星期日。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#BeginOfWeek)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#BeginOfWeek)] [[play](https://go.dev/play/p/ynjoJPz7VNV)] - **BeginOfMonth** : 返回指定时间的当月开始时间。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#BeginOfMonth)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#BeginOfMonth)] [[play](https://go.dev/play/p/bWXVFsmmzwL)] - **BeginOfYear** : 返回指定时间的当年开始时间。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#BeginOfYear)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#BeginOfYear)] [[play](https://go.dev/play/p/i326DSwLnV8)] - **EndOfMinute** : 返回指定时间的分钟结束时间。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#EndOfMinute)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#EndOfMinute)] [[play](https://go.dev/play/p/yrL5wGzPj4z)] - **EndOfHour** : 返回指定时间的小时结束时间。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#EndOfHour)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#EndOfHour)] [[play](https://go.dev/play/p/6ce3j_6cVqN)] - **EndOfDay** : 返回指定时间的当天结束时间。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#EndOfDay)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#EndOfDay)] [[play](https://go.dev/play/p/eMBOvmq5Ih1)] - **EndOfWeek** : 返回指定时间的星期结束时间,默认结束时间星期六。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#EndOfWeek)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#EndOfWeek)] [[play](https://go.dev/play/p/i08qKXD9flf)] - **EndOfMonth** : 返回指定时间的月份结束时间。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#EndOfMonth)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#EndOfMonth)] [[play](https://go.dev/play/p/_GWh10B3Nqi)] - **EndOfYear** : 返回指定时间的年份结束时间。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#EndOfYear)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#EndOfYear)] [[play](https://go.dev/play/p/G01cKlMCvNm)] - **GetNowDate** : 获取当天日期,返回格式:yyyy-mm-dd。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#GetNowDate)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#GetNowDate)] [[play](https://go.dev/play/p/PvfkPpcpBBf)] - **GetNowTime** : 获取当时时间,返回格式:hh:mm:ss。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#GetNowTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#GetNowTime)] [[play](https://go.dev/play/p/l7BNxCkTmJS)] - **GetNowDateTime** : 获取当时日期和时间,返回格式:yyyy-mm-dd hh:mm:ss。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#GetNowDateTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#GetNowDateTime)] [[play](https://go.dev/play/p/pI4AqngD0al)] - **GetTodayStartTime** : 返回当天开始时间, 格式: yyyy-mm-dd 00:00:00。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#GetTodayStartTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#GetTodayStartTime)] [[play](https://go.dev/play/p/84siyYF7t99)] - **GetTodayEndTime** : 返回当天结束时间,格式: yyyy-mm-dd 23:59:59。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#GetTodayEndTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#GetTodayEndTime)] [[play](https://go.dev/play/p/jjrLnfoqgn3)] - **GetZeroHourTimestamp** : 获取零时时间戳(timestamp of 00:00)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#GetZeroHourTimestamp)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#GetZeroHourTimestamp)] [[play](https://go.dev/play/p/QmL2oIaGE3q)] - **GetNightTimestamp** : 获取午夜时间戳(timestamp of 23:59)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#GetNightTimestamp)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#GetNightTimestamp)] [[play](https://go.dev/play/p/UolysR3MYP1)] - **FormatTimeToStr** : 将日期格式化成字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#FormatTimeToStr)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#FormatTimeToStr)] [[play](https://go.dev/play/p/_Ia7M8H_OvE)] - **FormatStrToTime** : 将字符串格式化成时间。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#FormatStrToTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#FormatStrToTime)] [[play](https://go.dev/play/p/1h9FwdU8ql4)] - **NewUnix** : 创建一个 unix 时间戳。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#NewUnix)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#NewUnix)] [[play](https://go.dev/play/p/psoSuh_kLRt)] - **NewUnixNow** : 创建一个当前时间的 unix 时间戳。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#NewUnixNow)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#NewUnixNow)] [[play](https://go.dev/play/p/U4PPx-9D0oz)] - **NewFormat** : 创建一个 yyyy-mm-dd hh:mm:ss 格式时间字符串的 unix 时间戳。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#NewFormat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#NewFormat)] [[play](https://go.dev/play/p/VkW08ZOaXPZ)] - **NewISO8601** : 创建一个 iso8601 格式时间字符串的 unix 时间戳。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#NewISO8601)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#NewISO8601)] [[play](https://go.dev/play/p/mkhOHQkdeA2)] - **ToUnix** : 返回 unix 时间戳。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#ToUnix)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#ToUnix)] [[play](https://go.dev/play/p/_LUiwAdocjy)] - **ToFormat** : 返回格式'yyyy-mm-dd hh:mm:ss'的日期字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#ToFormat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#ToFormat)] [[play](https://go.dev/play/p/VkW08ZOaXPZ)] - **ToFormatForTpl** : 返回 tpl 格式指定的日期字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#ToFormatForTpl)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#ToFormatForTpl)] [[play](https://go.dev/play/p/nyXxXcQJ8L5)] - **ToIso8601** : 返回 iso8601 日期字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#ToIso8601)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#ToIso8601)] [[play](https://go.dev/play/p/mkhOHQkdeA2)] - **IsLeapYear** :验证是否是闰年。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#IsLeapYear)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#IsLeapYear)] [[play](https://go.dev/play/p/xS1eS2ejGew)] - **IsLeapYear** : check if param `year` is leap year or not. - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#IsLeapYear)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#IsLeapYear)] [[play](https://go.dev/play/p/xS1eS2ejGew)] - **BetweenSeconds** : 返回两个时间的间隔秒数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#BetweenSeconds)] - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime.md#BetweenSeconds)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#BetweenSeconds)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#BetweenSeconds)] - **DayOfYear** : 返回参数日期是一年中的第几天。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#DayOfYear)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#DayOfYear)] [[play](https://go.dev/play/p/0hjqhTwFNlH)] - **IsWeekend** : 判断日期是否是周末。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#IsWeekend)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#IsWeekend)] [[play](https://go.dev/play/p/cupRM5aZOIY)] - **NowDateOrTime** : 根据指定的格式和时区返回当前时间字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#NowDateOrTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#NowDateOrTime)] [[play](https://go.dev/play/p/EZ-begEjtT0)] - **Timestamp** : 返回当前秒级时间戳。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#Timestamp)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#Timestamp)] [[play](https://go.dev/play/p/iU5b7Vvjx6x)] - **TimestampMilli** : 返回当前毫秒级时间戳。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#TimestampMilli)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#TimestampMilli)] [[play](https://go.dev/play/p/4gvEusOTu1T)] - **TimestampMicro** : 返回当前微秒级时间戳。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#TimestampMicro)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#TimestampMicro)] [[play](https://go.dev/play/p/2maANglKHQE)] - **TimestampNano** : 返回当前纳秒级时间戳。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datetime_zh-CN.md#TimestampNano)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datetime.md#TimestampNano)] [[play](https://go.dev/play/p/A9Oq_COrcCF)]

8. datastructure 包含一些普通的数据结构实现。例如:list, linklist, stack, queue, set, tree, graph。       回到目录

@@ -607,23 +607,23 @@ import hashmap "github.com/duke-git/lancet/v2/datastructure/hashmap" #### 函数列表: - **List** : 线性表结构, 用切片实现。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/list_zh-CN.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datastructure/list.md)] - **CopyOnWriteList** : 是一个线程安全的 List 实现,底层使用 go 切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/copyonwritelist_zh-CN.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datastructure/copyonwritelist.md)] - **Link** : 链表解构, 包括单链表和双向链表。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/link_zh-CN.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datastructure/link.md)] - **Stack** : 栈结构(fifo), 包括数组栈和链表栈。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/stack_zh-CN.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datastructure/stack.md)] - **Queue** : 队列结构(filo), 包括数组队列,链表队列,循环队列,优先级队列。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/queue_zh-CN.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datastructure/queue.md)] - **Set** : 集合(set)结构。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/set_zh-CN.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datastructure/set.md)] - **Tree** : 二叉搜索树。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/tree_zh-CN.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datastructure/tree.md)] - **Heap** : 二叉 max 堆。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/heap_zh-CN.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datastructure/heap.md)] - **Hashmap** : 哈希映射。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/datastructure/hashmap_zh-CN.md)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/datastructure/hashmap.md)]

9. fileutil 包含文件基本操作。       回到目录

@@ -634,78 +634,78 @@ import "github.com/duke-git/lancet/v2/fileutil" #### 函数列表: - **ClearFile** : 清空文件内容。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#ClearFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#ClearFile)] [[play](https://go.dev/play/p/NRZ0ZT-G94H)] - **CreateFile** : 创建文件,创建成功返回 true, 否则返回 false。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#CreateFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#CreateFile)] [[play](https://go.dev/play/p/lDt8PEsTNKI)] - **CreateDir** : 创建嵌套目录,例如/a/, /a/b/。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#CreateDir)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#CreateDir)] [[play](https://go.dev/play/p/qUuCe1OGQnM)] - **CopyFile** :拷贝文件,会覆盖原有的文件。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#CopyFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#CopyFile)] [[play](https://go.dev/play/p/Jg9AMJMLrJi)] - **FileMode** : 获取文件 mode 信息。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#FileMode)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#FileMode)] [[play](https://go.dev/play/p/2l2hI42fA3p)] - **MiMeType** : 获取文件 mime 类型, 参数的类型必须是 string 或者\*os.File。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#MiMeType)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#MiMeType)] [[play](https://go.dev/play/p/bd5sevSUZNu)] - **IsExist** : 判断文件或目录是否存在。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#IsExist)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#IsExist)] [[play](https://go.dev/play/p/nKKXt8ZQbmh)] - **IsLink** : 判断文件是否是符号链接。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#IsLink)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#IsLink)] [[play](https://go.dev/play/p/TL-b-Kzvf44)] - **IsDir** : 判断参数是否是目录。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#IsDir)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#IsDir)] [[play](https://go.dev/play/p/WkVwEKqtOWk)] - **ListFileNames** : 返回目录下所有文件名。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#ListFileNames)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#ListFileNames)] [[play](https://go.dev/play/p/Tjd7Y07rejl)] - **RemoveFile** : 删除文件。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#RemoveFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#RemoveFile)] [[play](https://go.dev/play/p/P2y0XW8a1SH)] - **ReadFileToString** : 读取文件内容并返回字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#ReadFileToString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#ReadFileToString)] [[play](https://go.dev/play/p/cmfwp_5SQTp)] - **ReadFileByLine** : 按行读取文件内容,返回字符串切片包含每一行。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#ReadFileByLine)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#ReadFileByLine)] [[play](https://go.dev/play/p/svJP_7ZrBrD)] - **Zip** : zip 压缩文件, 参数可以是文件或目录。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#Zip)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#Zip)] [[play](https://go.dev/play/p/j-3sWBp8ik_P)] - **ZipAppendEntry** : 通过将单个文件或目录追加到现有的 zip 文件。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#ZipAppendEntry)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#ZipAppendEntry)] - **UnZip** : zip 解压缩文件并保存在目录中。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#UnZip)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#UnZip)] [[play](https://go.dev/play/p/g0w34kS7B8m)] - **CurrentPath** : 返回当前位置的绝对路径。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#CurrentPath)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#CurrentPath)] [[play](https://go.dev/play/p/s74a9iBGcSw)] - **IsZipFile** : 判断文件是否是 zip 压缩文件。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#IsZipFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#IsZipFile)] [[play](https://go.dev/play/p/9M0g2j_uF_e)] - **FileSize** : 返回文件字节大小。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#FileSize)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#FileSize)] [[play](https://go.dev/play/p/H9Z05uD-Jjc)] - **MTime** : 返回文件修改时间(unix timestamp)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#MTime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#MTime)] [[play](https://go.dev/play/p/s_Tl7lZoAaY)] - **Sha** : 返回文件 sha 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#Sha)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#Sha)] [[play](https://go.dev/play/p/VfEEcO2MJYf)] - **ReadCsvFile** : 读取 csv 文件内容到切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#ReadCsvFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#ReadCsvFile)] [[play](https://go.dev/play/p/OExTkhGEd3_u)] - **WriteCsvFile** : 向 csv 文件写入内容。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#WriteCsvFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#WriteCsvFile)] [[play](https://go.dev/play/p/dAXm58Q5U1o)] - **WriteBytesToFile** : 将 bytes 写入文件。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#WriteBytesToFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#WriteBytesToFile)] [[play](https://go.dev/play/p/s7QlDxMj3P8)] - **WriteStringToFile** : 将字符串写入文件。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/fileutil_zh-CN.md#WriteStringToFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/fileutil.md#WriteStringToFile)] [[play](https://go.dev/play/p/GhLS6d8lH_g)]

10. formatter 格式化器包含一些数据格式化处理方法。       回到目录

@@ -717,25 +717,25 @@ import "github.com/duke-git/lancet/v2/formatter" #### 函数列表: - **Comma** : 用逗号每隔 3 位分割数字/字符串,支持前缀添加符号。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#Comma)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/formatter.md#Comma)] [[play](https://go.dev/play/p/eRD5k2vzUVX)] - **Pretty** : 返回 pretty JSON 字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#Pretty)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/formatter.md#Pretty)] [[play](https://go.dev/play/p/YsciGj3FH2x)] - **PrettyToWriter** : Pretty encode 数据到 writer。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#PrettyToWriter)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/formatter.md#PrettyToWriter)] [[play](https://go.dev/play/p/LPLZ3lDi5ma)] - **DecimalBytes** : 返回十进制标准(以 1000 为基数)下的可读字节单位字符串。precision 参数指定小数点后的位数,默认为 4。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#DecimalBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/formatter.md#DecimalBytes)] [[play](https://go.dev/play/p/FPXs1suwRcs)] - **BinaryBytes** : 返回 binary 标准(以 1024 为基数)下的可读字节单位字符串。precision 参数指定小数点后的位数,默认为 4。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#BinaryBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/formatter.md#BinaryBytes)] [[play](https://go.dev/play/p/G9oHHMCAZxP)] - **ParseDecimalBytes** : 将字节单位字符串转换成其所表示的字节数(以 1000 为基数)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#ParseDecimalBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/formatter.md#ParseDecimalBytes)] [[play](https://go.dev/play/p/Am98ybWjvjj)] - **ParseBinaryBytes** : 将字节单位字符串转换成其所表示的字节数(以 1024 为基数)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#ParseBinaryBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/formatter.md#ParseBinaryBytes)] [[play](https://go.dev/play/p/69v1tTT62x8)]

11. function 函数包控制函数执行流程,包含部分函数式编程。       回到目录

@@ -747,31 +747,31 @@ import "github.com/duke-git/lancet/v2/function" #### 函数列表: - **After** : 创建一个函数,当该函数被调用 n 或更多次之后将执行传入的函数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function_zh-CN.md#After)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/function.md#After)] [[play](https://go.dev/play/p/eRD5k2vzUVX)] - **Before** : 创建一个函数,当该函数被调用不超过 n 次时,将执行执行传入的函数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function_zh-CN.md#Before)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/function.md#Before)] [[play](https://go.dev/play/p/0HqUDIFZ3IL)] - **CurryFn** : 创建柯里化函数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function_zh-CN.md#CurryFn)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/function.md#CurryFn)] [[play](https://go.dev/play/p/5HopfDwANKX)] - **Compose** : 从右至左组合函数列表 fnList,返回组合后的函数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function_zh-CN.md#Compose)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/function.md#Compose)] [[play](https://go.dev/play/p/KKfugD4PKYF)] - **Delay** : 延迟 delay 时间后调用函数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function_zh-CN.md#Delay)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/function.md#Delay)] [[play](https://go.dev/play/p/Ivtc2ZE-Tye)] - **Debounced** : 创建一个 debounced 函数,该函数延迟调用 fn 直到自上次调用 debounced 函数后等待持续时间过去。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function_zh-CN.md#Debounced)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/function.md#Debounced)] [[play](https://go.dev/play/p/absuEGB_GN7)] - **Schedule** : 每次持续时间调用函数,直到关闭返回的 channel。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function_zh-CN.md#Schedule)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/function.md#Schedule)] [[play](https://go.dev/play/p/hbON-Xeyn5N)] - **Pipeline** : 从右至左执行函数列表。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function_zh-CN.md#Pipeline)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/function.md#Pipeline)] [[play](https://go.dev/play/p/mPdUVvj6HD6)] - **Watcher** : Watcher 用于记录代码执行时间。可以启动/停止/重置手表定时器。获取函数执行的时间。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/function_zh-CN.md#Watcher)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/function.md#Watcher)] [[play](https://go.dev/play/p/l2yrOpCLd1I)]

12. maputil 包括一些操作 map 的函数。       回到目录

@@ -783,94 +783,94 @@ import "github.com/duke-git/lancet/v2/maputil" #### 函数列表: - **MapTo** : 快速将 map 或者其他类型映射到结构体或者指定类型。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#MapTo)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#MapTo)] [[play](https://go.dev/play/p/4K7KBEPgS5M)] - **ForEach** : 对 map 中的每对 key 和 value 执行 iteratee 函数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#ForEach)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#ForEach)] [[play](https://go.dev/play/p/OaThj6iNVXK)] - **Filter** : 迭代 map 中的每对 key 和 value,返回 map,其中的 key 和 value 符合 predicate 函数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#Filter)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#Filter)] [[play](https://go.dev/play/p/fSvF3wxuNG7)] - **FilterByKeys** : 迭代 map, 返回一个新 map,其 key 都是给定的 key 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN#FilterByKeys)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil#FilterByKeys)] [[play](https://go.dev/play/p/7ov6BJHbVqh)] - **FilterByValues** : 迭代 map, 返回一个新 map,其 value 都是给定的 value 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN#FilterByValues)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil#FilterByValues)] [[play](https://go.dev/play/p/P3-9MdcXegR)] - **OmitBy** : Filter 的反向操作, 迭代 map 中的每对 key 和 value, 删除符合 predicate 函数的 key, value, 返回新 map。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN#OmitBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil#OmitBy)] [[play](https://go.dev/play/p/YJM4Hj5hNwm)] - **OmitByKeys** : FilterByKeys 的反向操作, 迭代 map, 返回一个新 map,其 key 不包括给定的 key 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN#OmitByKeys)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil#OmitByKeys)] [[play](https://go.dev/play/p/jXGrWDBfSRp)] - **OmitByValues** : FilterByValues 的反向操作, 迭代 map, 返回一个新 map,其 value 不包括给定的 value 值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN#OmitByValues)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil#OmitByValues)] [[play](https://go.dev/play/p/XB7Y10uw20_U)] - **Intersect** : 多个 map 的交集操作。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#Intersect)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#Intersect)] [[play](https://go.dev/play/p/Zld0oj3sjcC)] - **Keys** : 返回 map 中所有 key 组成的切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#Keys)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#Keys)] [[play](https://go.dev/play/p/xNB5bTb97Wd)] - **KeysBy** : 创建一个切片,其元素是每个 map 的 key 调用 mapper 函数的结果。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN#KeysBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil#KeysBy)] [[play](https://go.dev/play/p/hI371iB8Up8)] - **Merge** : 合并多个 map, 相同的 key 会被之后的 key 覆盖。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#Merge)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#Merge)] [[play](https://go.dev/play/p/H95LENF1uB-)] - **Minus** : 返回一个 map,其中的 key 存在于 mapA,不存在于 mapB。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#Minus)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#Minus)] [[play](https://go.dev/play/p/3u5U9K7YZ9m)] - **Values** : 返回 map 中所有 values 组成的切片 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#Values)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#Values)] [[play](https://go.dev/play/p/CBKdUc5FTW6)] - **ValuesBy** : 创建一个切片,其元素是每个 map 的 value 调用 mapper 函数的结果。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#ValuesBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#ValuesBy)] [[play](https://go.dev/play/p/sg9-oRidh8f)] - **MapKeys** : 操作 map 的每个 key,然后转为新的 map。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#MapKeys)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#MapKeys)] [[play](https://go.dev/play/p/8scDxWeBDKd)] - **MapValues** : 操作 map 的每个 value,然后转为新的 map。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#MapValues)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#MapValues)] [[play](https://go.dev/play/p/g92aY3fc7Iw)] - **Entries** : 将 map 转换为键/值对切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#Entries)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#Entries)] [[play](https://go.dev/play/p/Ltb11LNcElY)] - **FromEntries** : 基于键/值对的切片创建 map。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#FromEntries)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#FromEntries)] [[play](https://go.dev/play/p/fTdu4sCNjQO)] - **Transform** : 将 map 转换为其他类型的 map。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#Transform)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#Transform)] [[play](https://go.dev/play/p/P6ovfToM3zj)] - **IsDisjoint** : 验证两个 map 是否具有不同的 key。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#IsDisjoint)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#IsDisjoint)] [[play](https://go.dev/play/p/N9qgYg_Ho6f)] - **HasKey** : 检查 map 是否包含某个 key。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#HasKey)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#HasKey)] [[play](https://go.dev/play/p/isZZHOsDhFc)] - **NewConcurrentMap** : ConcurrentMap 协程安全的 map 结构。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#NewConcurrentMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#NewConcurrentMap)] [[play](https://go.dev/play/p/3PenTPETJT0)] - **ConcurrentMap_Set** : 在 map 中设置 key 和 value。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#ConcurrentMap_Set)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#ConcurrentMap_Set)] [[play](https://go.dev/play/p/3PenTPETJT0)] - **ConcurrentMap_Get** : 根据 key 获取 value, 如果不存在 key,返回零值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#ConcurrentMap_Get)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#ConcurrentMap_Get)] [[play](https://go.dev/play/p/3PenTPETJT0)] - **ConcurrentMap_GetOrSet** : 返回键的现有值(如果存在),否则,设置 key 并返回给定值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#ConcurrentMap_GetOrSet)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#ConcurrentMap_GetOrSet)] [[play](https://go.dev/play/p/aDcDApOK01a)] - **ConcurrentMap_Delete** : 删除 key。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#ConcurrentMap_Delete)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#ConcurrentMap_Delete)] [[play](https://go.dev/play/p/uTIJZYhpVMS)] - **ConcurrentMap_GetAndDelete** :获取 key,然后删除。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#ConcurrentMap_GetAndDelete)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#ConcurrentMap_GetAndDelete)] [[play](https://go.dev/play/p/ZyxeIXSZUiM)] - **ConcurrentMap_Has** : 验证是否包含 key。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#ConcurrentMap_Has)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#ConcurrentMap_Has)] [[play](https://go.dev/play/p/C8L4ul9TVwf)] - **ConcurrentMap_Range** : 为 map 中每个键和值顺序调用迭代器。 如果 iterator 返回 false,则停止迭代。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#ConcurrentMap_Range)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/maputil.md#ConcurrentMap_Range)] [[play](https://go.dev/play/p/iqcy7P8P0Pr)]

13. mathutil 包实现了一些数学计算的函数。       回到目录

@@ -882,79 +882,79 @@ import "github.com/duke-git/lancet/v2/mathutil" #### 函数列表: - **Average** :计算平均数,可能需要对结果调用 RoundToFloat 方法四舍五入。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Average)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Average)] [[play](https://go.dev/play/p/Vv7LBwER-pz)] - **Exponent** : 指数计算(x 的 n 次方)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Exponent)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Exponent)] [[play](https://go.dev/play/p/uF3HGNPk8wr)] - **Fibonacci** :计算斐波那契数列的第 n 个数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Fibonacci)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Fibonacci)] [[play](https://go.dev/play/p/IscseUNMuUc)] - **Factorial** : 计算阶乘。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Factorial)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Factorial)] [[play](https://go.dev/play/p/tt6LdOK67Nx)] - **Max** : 返回参数中的最大数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Max)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Max)] [[play](https://go.dev/play/p/cN8DHI0rTkH)] - **MaxBy** : 使用给定的比较器函数返回切片的最大值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#MaxBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#MaxBy)] [[play](https://go.dev/play/p/pbe2MT-7DV2)] - **Min** : 返回参数中的最小数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Min)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Min)] [[play](https://go.dev/play/p/21BER_mlGUj)] - **MinBy** : 使用给定的比较器函数返回切片的最小值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#MinBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#MinBy)] [[play](https://go.dev/play/p/N9qgYg_Ho6f)] - **Percent** : 计算百分比,可以指定保留 n 位小数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Percent)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Percent)] [[play](https://go.dev/play/p/s0NdFCtwuyd)] - **RoundToFloat** : 四舍五入,保留 n 位小数,返回 float64。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#RoundToFloat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#RoundToFloat)] [[play](https://go.dev/play/p/ghyb528JRJL)] - **RoundToString** : 四舍五入,保留 n 位小数,返回 string。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#RoundToString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#RoundToString)] [[play](https://go.dev/play/p/kZwpBRAcllO)] - **TruncRound** : 截短 n 位小数(不进行四舍五入)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#TruncRound)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#TruncRound)] [[play](https://go.dev/play/p/aumarSHIGzP)] - **Range** : 根据指定的起始值和数量,创建一个数字切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Range)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Range)] [[play](https://go.dev/play/p/9ke2opxa8ZP)] - **RangeWithStep** : 根据指定的起始值,结束值,步长,创建一个数字切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#RangeWithStep)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#RangeWithStep)] [[play](https://go.dev/play/p/akLWz0EqOSM)] - **AngleToRadian** : 将角度值转为弧度值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#AngleToRadian)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#AngleToRadian)] [[play](https://go.dev/play/p/CIvlICqrHql)] - **RadianToAngle** : 将弧度值转为角度值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#RadianToAngle)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#RadianToAngle)] [[play](https://go.dev/play/p/dQtmOTUOMgi)] - **PointDistance** : 计算两个坐标点的距离。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#PointDistance)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#PointDistance)] [[play](https://go.dev/play/p/RrG4JIaziM8)] - **IsPrime** : 判断质数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#IsPrime)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#IsPrime)] [[play](https://go.dev/play/p/Rdd8UTHZJ7u)] - **GCD** : 求最大公约数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#GCD)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#GCD)] [[play](https://go.dev/play/p/CiEceLSoAKB)] - **LCM** : 求最小公倍数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#LCM)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#LCM)] [[play](https://go.dev/play/p/EjcZxfY7G_g)] - **Cos** : 计算弧度的余弦值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Cos)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Cos)] [[play](https://go.dev/play/p/Sm89LoIfvFq)] - **Sin** : 计算弧度的正弦值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Sin)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Sin)] [[play](https://go.dev/play/p/TWMQlMywDsP)] - **Log** : 计算以 base 为底 n 的对数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Log)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Log)] [[play](https://go.dev/play/p/_d4bi8oyhat)] - **Sum** : 求传入参数之和。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Sum)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Sum)] [[play](https://go.dev/play/p/1To2ImAMJA7)] - **Abs** : 求绝对值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/mathutil_zh-CN.md#Sum)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/mathutil.md#Sum)] [[play](https://go.dev/play/p/fsyBh1Os-1d)]

14. netutil 网络包支持获取 ip 地址,发送 http 请求。       回到目录

@@ -966,68 +966,68 @@ import "github.com/duke-git/lancet/v2/netutil" #### 函数列表: - **ConvertMapToQueryString** : 将 map 转换成 http 查询字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#ConvertMapToQueryString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#ConvertMapToQueryString)] [[play](https://go.dev/play/p/jnNt_qoSnRi)] - **EncodeUrl** : 编码 url query string 的值(?a=1&b=[2] -> ?a=1&b=%5B2%5D)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#EncodeUrl)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#EncodeUrl)] [[play](https://go.dev/play/p/bsZ6BRC4uKI)] - **GetInternalIp** : 获取内部 ipv4。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#GetInternalIp)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#GetInternalIp)] [[play](https://go.dev/play/p/5mbu-gFp7ei)] - **GetIps** : 获取系统 ipv4 地址列表。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#GetIps)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#GetIps)] [[play](https://go.dev/play/p/NUFfcEmukx1)] - **GetMacAddrs** : 获取系统 mac 地址列。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#GetMacAddrs)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#GetMacAddrs)] [[play](https://go.dev/play/p/Rq9UUBS_Xp1)] - **GetPublicIpInfo** : 获取[公网 ip 信息](http://ip-api.com/json/). - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#GetPublicIpInfo)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#GetPublicIpInfo)] [[play](https://go.dev/play/p/YDxIfozsRHR)] - **GetRequestPublicIp** : 获取 http 请求 ip。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#GetRequestPublicIp)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#GetRequestPublicIp)] [[play](https://go.dev/play/p/kxU-YDc_eBo)] - **IsPublicIP** : 判断 ip 是否是公共 ip。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#IsPublicIP)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#IsPublicIP)] [[play](https://go.dev/play/p/nmktSQpJZnn)] - **IsInternalIP** : 判断 ip 是否是局域网 ip。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#IsInternalIP)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#IsInternalIP)] [[play](https://go.dev/play/p/sYGhXbgO4Cb)] - **HttpRequest** : 用于抽象 HTTP 请求实体的结构。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#HttpRequest)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#HttpRequest)] [[play](https://go.dev/play/p/jUSgynekH7G)] - **HttpClient** : 用于发送 HTTP 请求。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#HttpClient)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#HttpClient)] [[play](https://go.dev/play/p/jUSgynekH7G)] - **SendRequest** : 发送 http 请求。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#SendRequest)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#SendRequest)] [[play](https://go.dev/play/p/jUSgynekH7G)] - **DecodeResponse** : 解析 http 响应体到目标结构体。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#DecodeResponse)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#DecodeResponse)] [[play](https://go.dev/play/p/jUSgynekH7G)] - **StructToUrlValues** : 将结构体转为 url values, 仅转化结构体导出字段并且包含`json` tag。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#StructToUrlValues)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#StructToUrlValues)] [[play](https://go.dev/play/p/pFqMkM40w9z)] - **HttpGetdeprecated** : 发送 http get 请求(已弃用:SendRequest 代替)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#HttpGet)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#HttpGet)] - **HttpDeletedeprecated** : 发送 http delete 请求(已弃用:SendRequest 代替)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#HttpDelete)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#HttpDelete)] - **HttpPostdeprecated** : 发送 http post 请求(已弃用:SendRequest 代替)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#HttpPost)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#HttpPost)] - **HttpPutdeprecated** : 发送 http put 请求(已弃用:SendRequest 代替)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#HttpPut)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#HttpPut)] - **HttpPatchdeprecated** : 发送 http patch 请求(已弃用:SendRequest 代替)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#HttpPatch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#HttpPatch)] - **ParseHttpResponse** : 解析 http 响应体到目标结构体。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#ParseHttpResponse)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#ParseHttpResponse)] - **DownloadFile** : 从指定的 server 地址下载文件。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#DownloadFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#DownloadFile)] - **UploadFile** : 将文件上传指定的 server 地址。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#UploadFile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#UploadFile)] - **IsPingConnected** : 检查能否 ping 通主机。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#IsPingConnected)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#IsPingConnected)] [[play](https://go.dev/play/p/q8OzTijsA87)] - **IsTelnetConnected** : 检查能否 telnet 到主机。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/netutil_zh-CN.md#IsTelnetConnected)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/netutil.md#IsTelnetConnected)] [[play](https://go.dev/play/p/yiLCGtQv_ZG)]

15. pointer 包支持一些指针类型的操作。       回到目录

@@ -1039,19 +1039,19 @@ import "github.com/duke-git/lancet/v2/pointer" #### 函数列表: - **ExtractPointer** : 返回传入 interface 的底层值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/pointer_zh-CN.md#ExtractPointer)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/pointer.md#ExtractPointer)] [[play](https://go.dev/play/p/D7HFjeWU2ZP)] - **Of** : 返回传入参数的指针值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/pointer_zh-CN.md#Of)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/pointer.md#Of)] [[play](https://go.dev/play/p/HFd70x4DrMj)] - **Unwrap** : 返回传入指针指向的值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/pointer_zh-CN.md#Unwrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/pointer.md#Unwrap)] [[play](https://go.dev/play/p/cgeu3g7cjWb) - **UnwarpOr** : 返回指针的值,如果指针为零值,则返回 fallback。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/pointer_zh-CN.md#UnwrapOr)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/pointer.md#UnwrapOr)] [[play](https://go.dev/play/p/mmNaLC38W8C)] - **UnwarpOrDefault** : 返回指针的值,如果指针为零值,则返回相应零值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/pointer_zh-CN.md#UnwrapOrDefault)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/pointer.md#UnwrapOrDefault)] [[play](https://go.dev/play/p/ZnGIHf8_o4E)]

16. random 随机数生成器包,可以生成随机[]bytes, int, string。       回到目录

@@ -1063,31 +1063,31 @@ import "github.com/duke-git/lancet/v2/random" #### 函数列表: - **RandBytes** : 生成随机字节切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random_zh-CN.md#RandBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/random.md#RandBytes)] [[play](https://go.dev/play/p/EkiLESeXf8d)] - **RandInt** : 生成随机 int, 范围[min, max)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random_zh-CN.md#RandInt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/random.md#RandInt)] [[play](https://go.dev/play/p/pXyyAAI5YxD)] - **RandString** : 生成给定长度的随机字符串,只包含字母(a-zA-Z)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random_zh-CN.md#RandString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/random.md#RandString)] [[play](https://go.dev/play/p/W2xvRUXA7Mi)] - **RandUpper** : 生成给定长度的随机大写字母字符串(A-Z)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random_zh-CN.md#RandUpper)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/random.md#RandUpper)] [[play](https://go.dev/play/p/29QfOh0DVuh)] - **RandLower** : 生成给定长度的随机小写字母字符串(a-z)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random_zh-CN.md#RandLower)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/random.md#RandLower)] [[play](https://go.dev/play/p/XJtZ471cmtI)] - **RandNumeral** : 生成给定长度的随机数字字符串(0-9)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random_zh-CN.md#RandNumeral)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/random.md#RandNumeral)] [[play](https://go.dev/play/p/g4JWVpHsJcf)] - **RandNumeralOrLetter** : 生成给定长度的随机字符串(数字+字母)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random_zh-CN.md#RandNumeralOrLetter)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/random.md#RandNumeralOrLetter)] [[play](https://go.dev/play/p/19CEQvpx2jD)] - **UUIdV4** : 生成 UUID v4 字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random_zh-CN.md#UUIdV4)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/random.md#UUIdV4)] [[play](https://go.dev/play/p/_Z9SFmr28ft)] - **RandUniqueIntSlice** : 生成一个不重复的长度为 n 的随机 int 切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/random_zh-CN.md#RandUniqueIntSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/random.md#RandUniqueIntSlice)] [[play](https://go.dev/play/p/uBkRSOz73Ec)]

17. retry 重试执行函数直到函数运行成功或被 context cancel。       回到目录

@@ -1099,19 +1099,19 @@ import "github.com/duke-git/lancet/v2/retry" #### 函数列表: - **Context** : 设置重试 context 参数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/retry_zh-CN.md#Context)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/retry.md#Context)] [[play](https://go.dev/play/p/xnAOOXv9GkS)] - **Retry** : 重试执行函数 retryFunc,直到函数运行成功,或被 context 取消。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/retry_zh-CN.md#Retry)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/retry.md#Retry)] [[play](https://go.dev/play/p/nk2XRmagfVF)] - **RetryFunc** : 重试执行的函数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/retry_zh-CN.md#RetryFunc)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/retry.md#RetryFunc)] [[play](https://go.dev/play/p/nk2XRmagfVF)] - **RetryDuration** : 设置重试间隔时间,默认 3 秒。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/retry_zh-CN.md#RetryDuration)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/retry.md#RetryDuration)] [[play](https://go.dev/play/p/nk2XRmagfVF)] - **RetryTimes** : 设置重试次数,默认 5。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/retry_zh-CN.md#RetryTimes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/retry.md#RetryTimes)] [[play](https://go.dev/play/p/ssfVeU2SwLO)]

18. slice 包含操作切片的方法集合。        [回到目录](#index) @@ -1123,211 +1123,211 @@ import "github.com/duke-git/lancet/v2/slice" #### 函数列表: - **AppendIfAbsent** : 当前切片中不包含值时,将该值追加到切片中。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#AppendIfAbsent)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#AppendIfAbsent)] [[play](https://go.dev/play/p/GNdv7Jg2Taj)] - **Contain** : 判断 slice 是否包含 value。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Contain)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Contain)] [[play](https://go.dev/play/p/_454yEHcNjf)] - **ContainBy** : 根据 predicate 函数判断切片是否包含某个值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#ContainBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#ContainBy)] [[play](https://go.dev/play/p/49tkHfX4GNc)] - **ContainSubSlice** : 判断 slice 是否包含 subslice。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#ContainSubSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#ContainSubSlice)] [[play](https://go.dev/play/p/bcuQ3UT6Sev)] - **Chunk** : 按照 size 参数均分 slice。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Chunk)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Chunk)] [[play](https://go.dev/play/p/b4Pou5j2L_C)] - **Compact** : 去除 slice 中的假值(false values are false, nil, 0, "")。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Compact)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Compact)] [[play](https://go.dev/play/p/pO5AnxEr3TK)] - **Concat** : 合并多个 slices 到一个 slice 中。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Concat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Concat)] [[play](https://go.dev/play/p/gPt-q7zr5mk)] - **Count** : 返回切片中指定元素的个数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Count)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Count)] [[play](https://go.dev/play/p/Mj4oiEnQvRJ)] - **CountBy** : 遍历切片,对每个元素执行函数 predicate. 返回符合函数返回值为 true 的元素的个数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#CountBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#CountBy)] [[play](https://go.dev/play/p/tHOccTMDZCC)] - **Difference** : 创建一个切片,其元素不包含在另一个给定切片中。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Difference)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Difference)] [[play](https://go.dev/play/p/VXvadzLzhDa)] - **DifferenceBy** : 将两个 slice 中的每个元素调用 iteratee 函数,并比较它们的返回值,如果不相等返回在 slice 中对应的值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#DifferenceBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#DifferenceBy)] [[play](https://go.dev/play/p/DiivgwM5OnC)] - **DifferenceWith** : 接受比较器函数,该比较器被调用以将切片的元素与值进行比较。 结果值的顺序和引用由第一个切片确定。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#DifferenceWith)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#DifferenceWith)] [[play](https://go.dev/play/p/v2U2deugKuV)] - **DeleteAt** : 删除切片中指定开始索引到结束索引的元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#DeleteAt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#DeleteAt)] [[play](https://go.dev/play/p/pJ-d6MUWcvK)] - **Drop** : 从切片头部删除 n 个元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Drop)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Drop)] [[play](https://go.dev/play/p/jnPO2yQsT8H)] - **DropRight** : 从切片尾部删除 n 个元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#DropRight)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#DropRight)] [[play](https://go.dev/play/p/8bcXvywZezG)] - **DropWhile** : 从切片的头部删除 n 个元素,这个 n 个元素满足 predicate 函数返回 true。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#DropWhile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#DropWhile)] [[play](https://go.dev/play/p/4rt252UV_qs)] - **DropRightWhile** : 从切片的尾部删除 n 个元素,这个 n 个元素满足 predicate 函数返回 true。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#DropRightWhile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#DropRightWhile)] [[play](https://go.dev/play/p/6wyK3zMY56e)] - **Equal** : 检查两个切片是否相等,相等条件:切片长度相同,元素顺序和值都相同。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Equal)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Equal)] [[play](https://go.dev/play/p/WcRQJ37ifPa)] - **EqualWith** : 检查两个切片是否相等,相等条件:对两个切片的元素调用比较函数 comparator,返回 true。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#EqualWith)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#EqualWith)] [[play](https://go.dev/play/p/b9iygtgsHI1)] - **Every** : 如果切片中的所有值都通过谓词函数,则返回 true。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Every)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Every)] [[play](https://go.dev/play/p/R8U6Sl-j8cD)] - **Filter** : 返回切片中通过 predicate 函数真值测试的所有元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Filter)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Filter)] [[play](https://go.dev/play/p/SdPna-7qK4T)] - **FilterMap** : 返回一个将 filter 和 map 操作应用于给定切片的切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#FilterMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#FilterMap)] [[play](https://go.dev/play/p/J94SZ_9MiIe)] - **Finddeprecated** : 遍历切片的元素,返回第一个通过 predicate 函数真值测试的元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Find)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Find)] [[play](https://go.dev/play/p/CBKeBoHVLgq)] - **FindBy** : 遍历切片的元素,返回第一个通过 predicate 函数真值测试的元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#FindBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#FindBy)] [[play](https://go.dev/play/p/n1lysBYl-GB)] - **FindLastdeprecated** : 从头到尾遍历 slice 的元素,返回最后一个通过 predicate 函数真值测试的元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#FindLast)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#FindLast)] [[play](https://go.dev/play/p/FFDPV_j7URd)] - **FindLastBy** : 从遍历 slice 的元素,返回最后一个通过 predicate 函数真值测试的元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#FindLastBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#FindLastBy)] [[play](https://go.dev/play/p/8iqomzyCl_s)] - **Flatten** : 将多维切片展平一层。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Flatten)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Flatten)] [[play](https://go.dev/play/p/hYa3cBEevtm)] - **FlattenDeep** : 将多维切片递归展平到一层。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#FlattenDeep)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#FlattenDeep)] [[play](https://go.dev/play/p/yjYNHPyCFaF)] - **FlatMap** : 将切片转换为其它类型切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#FlatMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#FlatMap)] [[play](https://go.dev/play/p/_QARWlWs1N_F)] - **ForEach** : 遍历切片的元素并为每个元素调用 iteratee 函数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#ForEach)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#ForEach)] [[play](https://go.dev/play/p/DrPaa4YsHRF)] - **ForEachWithBreak** : 遍历切片的元素并为每个元素调用 iteratee 函数,当 iteratee 函数返回 false 时,终止遍历。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#ForEachWithBreak)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#ForEachWithBreak)] [[play](https://go.dev/play/p/qScs39f3D9W)] - **GroupBy** : 迭代切片的元素,每个元素将按条件分组,返回两个切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#GroupBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#GroupBy)] [[play](https://go.dev/play/p/QVkPxzPR0iA)] - **GroupWith** : 创建一个 map,key 是 iteratee 遍历 slice 中的每个元素返回的结果。值是切片元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#GroupWith)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#GroupWith)] [[play](https://go.dev/play/p/ApCvMNTLO8a)] - **IntSlicedeprecated** : 将接口切片转换为 int 切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#IntSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#IntSlice)] [[play](https://go.dev/play/p/FdQXF0Vvqs-)] - **InterfaceSlicedeprecated** : 将值转换为 interface 切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#InterfaceSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#InterfaceSlice)] [[play](https://go.dev/play/p/FdQXF0Vvqs-)] - **Intersection** : 返回多个切片的交集。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Intersection)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Intersection)] [[play](https://go.dev/play/p/anJXfB5wq_t)] - **InsertAt** : 将元素插入到索引处的切片中。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#InsertAt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#InsertAt)] [[play](https://go.dev/play/p/hMLNxPEGJVE)] - **IndexOf** : 返回在切片中找到值的第一个匹配项的索引,如果找不到值,则返回-1。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#IndexOf)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#IndexOf)] [[play](https://go.dev/play/p/MRN1f0FpABb)] - **LastIndexOf** : 返回在切片中找到最后一个值的索引,如果找不到该值,则返回-1。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#LastIndexOf)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#LastIndexOf)] [[play](https://go.dev/play/p/DokM4cf1IKH)] - **Map** : 对 slice 中的每个元素执行 map 函数以创建一个新切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Map)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Map)] [[play](https://go.dev/play/p/biaTefqPquw)] - **Merge** : 合并多个切片(不会消除重复元素)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Merge)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Merge)] [[play](https://go.dev/play/p/lbjFp784r9N)] - **Reverse** : 反转切片中的元素顺序。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Reverse)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Reverse)] [[play](https://go.dev/play/p/8uI8f1lwNrQ)] - **Reducedeprecated** : 将切片中的元素依次运行 iteratee 函数,返回运行结果。(废弃:建议使用 ReduceBy) - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Reduce)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Reduce)] [[play](https://go.dev/play/p/_RfXJJWIsIm)] - **ReduceBy** : 对切片元素执行 reduce 操作。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#ReduceBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#ReduceBy)] [[play](https://go.dev/play/p/YKDpLi7gtee)] - **ReduceRight** : 类似 ReduceBy 操作,迭代切片元素顺序从右至左。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#ReduceRight)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#ReduceRight)] [[play](https://go.dev/play/p/qT9dZC03A1K)] - **Replace** : 返回切片的副本,其中前 n 个不重叠的 old 替换为 new。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Replace)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Replace)] [[play](https://go.dev/play/p/P5mZp7IhOFo)] - **ReplaceAll** : 返回切片的副本,将其中 old 全部替换为 new。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#ReplaceAll)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#ReplaceAll)] [[play](https://go.dev/play/p/CzqXMsuYUrx)] - **Repeat** : 创建一个切片,包含 n 个传入的 item。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Repeat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Repeat)] [[play](https://go.dev/play/p/1CbOmtgILUU)] - **Shuffle** : 随机打乱切片中的元素顺序。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Shuffle)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Shuffle)] [[play](https://go.dev/play/p/YHvhnWGU3Ge)] - **IsAscending** : 检查切片元素是否按升序排列。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#IsAscending)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#IsAscending)] [[play](https://go.dev/play/p/9CtsFjet4SH)] - **IsDescending** : 检查切片元素是否按降序排列。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#IsDescending)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#IsDescending)] [[play](https://go.dev/play/p/U_LljFXma14)] - **IsSorted** : 检查切片元素是否是有序的(升序或降序)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#IsSorted)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#IsSorted)] [[play](https://go.dev/play/p/nCE8wPLwSA-)] - **IsSortedByKey** : 通过 iteratee 函数,检查切片元素是否是有序的。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#IsSortedByKey)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#IsSortedByKey)] [[play](https://go.dev/play/p/tUoGB7DOHI4)] - **Sort** : 对任何有序类型(数字或字符串)的切片进行排序,使用快速排序算法。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Sort)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Sort)] [[play](https://go.dev/play/p/V9AVjzf_4Fk)] - **SortBy** : 按照 less 函数确定的升序规则对切片进行排序。排序不保证稳定性。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#SortBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#SortBy)] [[play](https://go.dev/play/p/DAhLQSZEumm)] - **SortByFielddeprecated** : 按字段对结构切片进行排序。slice 元素应为 struct,字段类型应为 int、uint、string 或 bool。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#SortByField)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#SortByField)] [[play](https://go.dev/play/p/fU1prOBP9p1)] - **Some** : 如果列表中的任何值通过谓词函数,则返回 true。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Some)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Some)] [[play](https://go.dev/play/p/4pO9Xf9NDGS)] - **StringSlicedeprecated** : 将接口切片转换为字符串切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#StringSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#StringSlice)] [[play](https://go.dev/play/p/W0TZDWCPFcI)] - **SymmetricDifference** : 返回一个切片,其中的元素存在于参数切片中,但不同时存储在于参数切片中(交集取反)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#h42nJX5xMln)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#h42nJX5xMln)] [[play](https://go.dev/play/p/1CbOmtgILUU)] - **ToSlice** : 将可变参数转为切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#ToSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#ToSlice)] [[play](https://go.dev/play/p/YzbzVq5kscN)] - **ToSlicePointer** : 将可变参数转为指针切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#ToSlicePointer)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#ToSlicePointer)] [[play](https://go.dev/play/p/gx4tr6_VXSF)] - **Unique** : 删除切片中的重复元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Unique)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Unique)] [[play](https://go.dev/play/p/AXw0R3ZTE6a)] - **UniqueBy** : 对切片的每个元素调用 iteratee 函数,然后删除重复元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#UniqueBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#UniqueBy)] [[play](https://go.dev/play/p/UR323iZLDpv)] - **Union** : 合并多个切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Union)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Union)] [[play](https://go.dev/play/p/hfXV1iRIZOf)] - **UnionBy** : 对切片的每个元素调用函数后,合并多个切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#UnionBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#UnionBy)] [[play](https://go.dev/play/p/HGKHfxKQsFi)] - **UpdateAt** : 更新索引处的切片元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#UpdateAt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#UpdateAt)] [[play](https://go.dev/play/p/f3mh2KloWVm)] - **Without** : 创建一个不包括所有给定值的切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Without)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Without)] [[play](https://go.dev/play/p/bwhEXEypThg)] - **KeyBy** :将切片每个元素调用函数后转为 map。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#KeyBy)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#KeyBy)] [[play](https://go.dev/play/p/uXod2LWD1Kg)] - **Join** : 用指定的分隔符链接切片元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Join)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/slice.md#Join)] [[play](https://go.dev/play/p/huKzqwNDD7V)]

19. stream 流,该包仅验证简单的 stream 实现,功能有限。       回到目录

@@ -1339,82 +1339,82 @@ import "github.com/duke-git/lancet/v2/stream" #### 函数列表: - **Of** : 创建元素为指定值的 stream。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Of)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Of)] [[play](https://go.dev/play/p/jI6_iZZuVFE)] - **FromSlice** : 从切片创建 stream。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#FromSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#FromSlice)] [[play](https://go.dev/play/p/wywTO0XZtI4)] - **FromChannel** : 从通道创建 stream。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#FromChannel)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#FromChannel)] [[play](https://go.dev/play/p/9TZYugGMhXZ)] - **FromRange** : 指定一个数字范围创建 stream, 范围两端点值都包括在内。. [start, end] - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#FromRange)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#FromRange)] [[play](https://go.dev/play/p/9Ex1-zcg-B-)] - **Generate** : 创建一个 stream,其中每个元素都由提供的生成器函数生成。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Generate)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Generate)] [[play](https://go.dev/play/p/rkOWL1yA3j9)] - **Concat** : 创建一个延迟连接 stream,其元素是第一个 stream 的所有元素,后跟第二个 stream 的全部元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Concat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Concat)] [[play](https://go.dev/play/p/HM4OlYk_OUC)] - **Distinct** : 创建并返回一个 stream,用于删除重复的项。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Distinct)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Distinct)] [[play](https://go.dev/play/p/eGkOSrm64cB)] - **Filter** : 返回一个通过判定函数的 stream。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Filter)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Filter)] [[play](https://go.dev/play/p/MFlSANo-buc)] - **Map** : 返回一个 stream,该 stream 由将给定函数应用于源 stream 元素的元素组成。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Map)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Map)] [[play](https://go.dev/play/p/OtNQUImdYko)] - **Peek** : 返回一个由源 stream 的元素组成的 stream,并在从生成的 stream 中消耗元素时对每个元素执行所提供的操作。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Peek)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Peek)] [[play](https://go.dev/play/p/u1VNzHs6cb2)] - **Skip** : 在丢弃 stream 的前 n 个元素后,返回由源 stream 的其余元素组成的 stream。如果此 stream 包含的元素少于 n 个,则将返回一个空 stream。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Skip)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Skip)] [[play](https://go.dev/play/p/fNdHbqjahum)] - **Limit** : 返回由源 stream 的元素组成的 stream,该 stream 被截断为长度不超过 maxSize。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Limit)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Limit)] [[play](https://go.dev/play/p/qsO4aniDcGf)] - **Reverse** : 返回元素与源 stream 的顺序相反的 stream。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Reverse)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Reverse)] [[play](https://go.dev/play/p/A8_zkJnLHm4)] - **Range** : 返回一个 stream,该 stream 的元素在从源 stream 的开始(包含)到结束(排除)的范围内。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Range)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Range)] [[play](https://go.dev/play/p/indZY5V2f4j)] - **Sorted** : 返回一个 stream,该 stream 由源 stream 的元素组成,并根据提供的 less 函数进行排序。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Sorted)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Sorted)] [[play](https://go.dev/play/p/XXtng5uonFj)] - **ForEach** : 对 stream 的每个元素执行一个操作。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#ForEach)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#ForEach)] [[play](https://go.dev/play/p/Dsm0fPqcidk)] - **Reduce** : 使用关联累加函数对 stream 的元素执行 reduce 操作,并 reduce 操作结果(如果有)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Reduce)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Reduce)] [[play](https://go.dev/play/p/6uzZjq_DJLU)] - **FindFirst** : 返回此 stream 的第一个元素,如果 stream 为空,则返回零值和 false。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#FindFirst)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#FindFirst)] [[play](https://go.dev/play/p/9xEf0-6C1e3)] - **FindLast** : 返回此 stream 的最后一个元素,如果 stream 为空,则返回零值和 false。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#FindLast)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#FindLast)] [[play](https://go.dev/play/p/WZD2rDAW-2h)] - **Max** : 根据提供的 less 函数返回 stream 的最大元素。less 函数: a > b - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Max)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Max)] [[play](https://go.dev/play/p/fm-1KOPtGzn)] - **Min** : 根据提供的 less 函数返回 stream 的最小元素。less 函数: a < b - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Min)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Min)] [[play](https://go.dev/play/p/vZfIDgGNRe_0)] - **AllMatch** : 判断 stream 的所有元素是否全部匹配指定判定函数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#AllMatch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#AllMatch)] [[play](https://go.dev/play/p/V5TBpVRs-Cx)] - **AnyMatch** : 判断 stream 是否包含匹配指定判定函数的元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#AnyMatch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#AnyMatch)] [[play](https://go.dev/play/p/PTCnWn4OxSn)] - **NoneMatch** : 判断 stream 的元素是否全部不匹配指定的判定函数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#NoneMatch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#NoneMatch)] [[play](https://go.dev/play/p/iWS64pL1oo3)] - **Count** : 返回 stream 中元素的数量。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Count)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#Count)] [[play](https://go.dev/play/p/r3koY6y_Xo-)] - **ToSlice** : 返回 stream 中的元素切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#ToSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/stream.md#ToSlice)] [[play](https://go.dev/play/p/jI6_iZZuVFE)]

20. structs 提供操作 struct, tag, field 的相关函数。       回到目录

@@ -1426,31 +1426,31 @@ import "github.com/duke-git/lancet/v2/structs" #### 函数列表: - **New** : `Struct`结构体的构造函数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/struct_zh-CN.md#New)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/struct.md#New)] - **ToMap** : 将一个合法的 struct 对象转换为 map[string]any。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/struct_zh-CN.md#ToMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/struct.md#ToMap)] - **Fields** : 获取一个 struct 对象的属性列表。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/struct_zh-CN.md#Fields)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/struct.md#Fields)] - **Field** : 根据属性名获取一个 struct 对象的属性。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/struct_zh-CN.md#Fields)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/struct.md#Fields)] - **IsStruct** : 判断是否为一个合法的 struct 对象。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/struct_zh-CN.md#IsStruct)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/struct.md#IsStruct)] - **Tag** : 获取`Field`的`Tag`,默认的 tag key 是 json。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field_zh-CN.md#Tag)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/field.md#Tag)] - **Name** : 获取属性名。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field_zh-CN.md#Name)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/field.md#Name)] - **Value** : 获取`Field`属性的值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field_zh-CN.md#Value)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/field.md#Value)] - **Kind** : 获取属性 Kind。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field_zh-CN.md#Kind)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/field.md#Kind)] - **IsEmbedded** : 判断属性是否为嵌入。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field_zh-CN.md#IsEmbedded)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/field.md#IsEmbedded)] - **IsExported** : 判断属性是否导出。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field_zh-CN.md#IsExported)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/field.md#IsExported)] - **IsZero** : 判断属性是否为零值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field_zh-CN.md#IsZero)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/field.md#IsZero)] - **IsSlice** : 判断属性是否是切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field_zh-CN.md#IsSlice)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/structs/field.md#IsSlice)]

21. strutil 包含字符串处理的相关函数。       回到目录

@@ -1461,115 +1461,115 @@ import "github.com/duke-git/lancet/v2/strutil" #### 函数列表: - **After** : 返回源字符串中指定字符串首次出现时的位置之后的子字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#After)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#After)] [[play](https://go.dev/play/p/RbCOQqCDA7m)] - **AfterLast** : 返回源字符串中指定字符串最后一次出现时的位置之后的子字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#AfterLast)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#AfterLast)] [[play](https://go.dev/play/p/1TegARrb8Yn)] - **Before** : 返回源字符串中指定字符串第一次出现时的位置之前的子字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#Before)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#Before)] [[play](https://go.dev/play/p/JAWTZDS4F5w)] - **BeforeLast** : 返回源字符串中指定字符串最后一次出现时的位置之前的子字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#BeforeLast)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#BeforeLast)] [[play](https://go.dev/play/p/pJfXXAoG_Te)] - **CamelCase** : 将字符串转换为 CamelCase 驼峰式字符串, 非字母和数字会被忽略。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#CamelCase)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#CamelCase)] [[play](https://go.dev/play/p/9eXP3tn2tUy)] - **Capitalize** : 将字符串的第一个字符转换为大写。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#Capitalize)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#Capitalize)] [[play](https://go.dev/play/p/2OAjgbmAqHZ)] - **ContainsAll** : 判断字符串是否包括全部给定的子字符串切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#ContainsAll)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#ContainsAll)] [[play](https://go.dev/play/p/KECtK2Os4zq)] - **ContainsAny** : 判断字符串是否包括给定的子字符串切片中任意一个子字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#ContainsAny)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#ContainsAny)] [[play](https://go.dev/play/p/dZGSSMB3LXE)] - **IsString** : 判断传入参数的数据类型是否为字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#IsString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#IsString)] [[play](https://go.dev/play/p/IOgq7oF9ERm)] - **KebabCase** : 将字符串转换为 kebab-case 形式字符串, 非字母和数字会被忽略。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#KebabCase)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#KebabCase)] [[play](https://go.dev/play/p/dcZM9Oahw-Y)] - **UpperKebabCase** : 将字符串转换为大写 KEBAB-CASE 形式字符串, 非字母和数字会被忽略。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#UpperKebabCase)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#UpperKebabCase)] [[play](https://go.dev/play/p/zDyKNneyQXk)] - **LowerFirst** : 将字符串的第一个字符转换为小写形式。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#LowerFirst)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#LowerFirst)] [[play](https://go.dev/play/p/CbzAyZmtJwL)] - **UpperFirst** : 将字符串的第一个字符转换为大写形式。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#UpperFirst)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#UpperFirst)] [[play](https://go.dev/play/p/sBbBxRbs8MM)] - **Pad** : 如果字符串长度短于 size,则在左右两侧填充字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#Pad)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#Pad)] [[play](https://go.dev/play/p/NzImQq-VF8q)] - **PadEnd** : 如果字符串短于限制大小,则在右侧用给定字符填充字符串。 如果填充字符超出大小,它们将被截断。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#PadEnd)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#PadEnd)] [[play](https://go.dev/play/p/9xP8rN0vz--)] - **PadStart** : 如果字符串短于限制大小,则在左侧用给定字符填充字符串。 如果填充字符超出大小,它们将被截断。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#PadStart)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#PadStart)] [[play](https://go.dev/play/p/xpTfzArDfvT)] - **Reverse** : 返回字符顺序与给定字符串相反的字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#Reverse)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#Reverse)] [[play](https://go.dev/play/p/adfwalJiecD)] - **SnakeCase** : 将字符串转换为 snake_case 形式, 非字母和数字会被忽略。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#SnakeCase)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#SnakeCase)] [[play](https://go.dev/play/p/tgzQG11qBuN)] - **UpperSnakeCase** : 将字符串转换为大写 SNAKE_CASE 形式, 非字母和数字会被忽略。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#UpperSnakeCase)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#UpperSnakeCase)] [[play](https://go.dev/play/p/4COPHpnLx38)] - **SplitEx** : 拆分给定的字符串可以控制结果切片是否包含空字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#SplitEx)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#SplitEx)] [[play](https://go.dev/play/p/Us-ySSbWh-3)] - **Substring** : 根据指定的位置和长度截取子字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#Substring)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#Substring)] [[play](https://go.dev/play/p/q3sM6ehnPDp)] - **Wrap** : 用给定字符包裹传入的字符串 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#Wrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#Wrap)] [[play](https://go.dev/play/p/KoZOlZDDt9y)] - **Unwrap** : 从另一个字符串中解开一个给定的字符串。 将更改源字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#Unwrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#Unwrap)] [[play](https://go.dev/play/p/Ec2q4BzCpG-)] - **SplitWords** : 将字符串拆分为单词,只支持字母字符单词。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#SplitWords)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#SplitWords)] [[play](https://go.dev/play/p/KLiX4WiysMM)] - **WordCount** : 返回有意义单词的数量,只支持字母字符单词。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#WordCount)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#WordCount)] [[play](https://go.dev/play/p/bj7_odx3vRf)] - **RemoveNonPrintable** : 删除字符串中不可打印的字符。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#RemoveNonPrintable)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#RemoveNonPrintable)] [[play](https://go.dev/play/p/og47F5x_jTZ)] - **StringToBytes** : 在不分配内存的情况下将字符串转换为字节片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#StringToBytes)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#StringToBytes)] [[play](https://go.dev/play/p/7OyFBrf9AxA)] - **BytesToString** : 在不分配内存的情况下将字节切片转换为字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#BytesToString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#BytesToString)] [[play](https://go.dev/play/p/6c68HRvJecH)] - **IsBlank** : 检查字符串是否为空格或空。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#IsBlank)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#IsBlank)] [[play](https://go.dev/play/p/6zXRH_c0Qd3)] - **HasPrefixAny** : 检查字符串是否以指定字符串数组中的任何一个开头。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#HasPrefixAny)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#HasPrefixAny)] [[play](https://go.dev/play/p/8UUTl2C5slo)] - **HasSuffixAny** : 检查字符串是否以指定字符串数组中的任何一个结尾。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#HasSuffixAny)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#HasSuffixAny)] [[play](https://go.dev/play/p/sKWpCQdOVkx)] - **IndexOffset** : 将字符串偏移 idxFrom 后,返回字符串中第一个 substr 实例的索引。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#IndexOffset)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#IndexOffset)] [[play](https://go.dev/play/p/qZo4lV2fomB)] - **ReplaceWithMap** : 返回 string 的副本,以无序的方式被 map 替换,区分大小写。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#ReplaceWithMap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#ReplaceWithMap)] [[play](https://go.dev/play/p/h3t7CNj2Vvu)] - **Trim** : 从字符串的开头和结尾去除空格(或其他字符)。 可选参数 characterMask 指定额外的剥离字符。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#Trim)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#Trim)] [[play](https://go.dev/play/p/Y0ilP0NRV3j)] - **SplitAndTrim** : 将字符串 str 按字符串 delimiter 拆分为一个切片,并对该数组的每个元素调用 Trim。忽略 Trim 后为空的元素。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#SplitAndTrim)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#SplitAndTrim)] [[play](https://go.dev/play/p/ZNL6o4SkYQ7)] - **HideString** : 隐藏源字符串中的一些字符。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#HideString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#HideString)] [[play](https://go.dev/play/p/pzbaIVCTreZ)] - **RemoveWhiteSpace** : 删除字符串中的空格。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#RemoveWhiteSpace)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/strutil.md#RemoveWhiteSpace)] [[play](https://go.dev/play/p/HzLC9vsTwkf)] @@ -1582,31 +1582,31 @@ import "github.com/duke-git/lancet/v2/system" #### 函数列表: - **IsWindows** : 检查当前操作系统是否是 windows。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system_zh-CN#IsWindows)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/system#IsWindows)] [[play](https://go.dev/play/p/XzJULbzmf9m)] - **IsLinux** : 检查当前操作系统是否是 linux。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system_zh-CN#IsLinux)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/system#IsLinux)] [[play](https://go.dev/play/p/zIflQgZNuxD)] - **IsMac** : 检查当前操作系统是否是 macos。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system_zh-CN#IsMac)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/system#IsMac)] [[play](https://go.dev/play/p/Mg4Hjtyq7Zc)] - **GetOsEnv** : 根据 key 获取对应的环境变量值 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system_zh-CN#GetOsEnv)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/system#GetOsEnv)] [[play](https://go.dev/play/p/D88OYVCyjO-)] - **SetOsEnv** : 设置环境变量。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system_zh-CN#SetOsEnv)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/system#SetOsEnv)] [[play](https://go.dev/play/p/D88OYVCyjO-)] - **RemoveOsEnv** : 删除环境变量。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system_zh-CN#RemoveOsEnv)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/system#RemoveOsEnv)] [[play](https://go.dev/play/p/fqyq4b3xUFQ)] - **CompareOsEnv** : 换取环境变量并与传入值进行比较。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system_zh-CN#CompareOsEnv)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/system#CompareOsEnv)] [[play](https://go.dev/play/p/BciHrKYOHbp)] - **ExecCommand** : 执行 shell 命令。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system_zh-CN#ExecCommand)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/system#ExecCommand)] [[play](https://go.dev/play/p/n-2fLyZef-4)] - **GetOsBits** : 获取当前操作系统位数(32/64)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/system_zh-CN#GetOsBits)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/system#GetOsBits)] [[play](https://go.dev/play/p/ml-_XH3gJbW)]

23. Tuple 包实现一个元组数据类型。       回到目录

@@ -1618,112 +1618,112 @@ import "github.com/duke-git/lancet/v2/tuple" #### 函数列表: - **Tuple2** : 2 元元组 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple2)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple2)] [[play](https://go.dev/play/p/3sHVqBQpLYN)] - **Tuple2_Unbox** : 返回 2 元元组的字段值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple2_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple2_Unbox)] [[play](https://go.dev/play/p/0fD1qfCVwjm)] - **Zip2** : 创建一个 Tuple2 元组切片, 其中元组的元素和传入切片元素相对应。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Zip2)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Zip2)] [[play](https://go.dev/play/p/4ncWJJ77Xio)] - **Unzip2** : 根据传入的 Tuple2 切片,创建一组和 Tuple2 元素相对应的切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Unzip2)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Unzip2)] [[play](https://go.dev/play/p/KBecr60feXb)] - **Tuple3** : 3 元元组 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple3)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple3)] [[play](https://go.dev/play/p/FtH2sdCLlCf)] - **Tuple3_Unbox** : 返回 3 元元组的字段值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple3_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple3_Unbox)] [[play](https://go.dev/play/p/YojLy-id1BS)] - **Zip3** : 创建一个 Tuple3 元组切片, 其中元组的元素和传入切片元素相对应。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Zip3)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Zip3)] [[play](https://go.dev/play/p/97NgmsTILfu)] - **Unzip3** : 根据传入的 Tuple3 切片,创建一组和 Tuple3 元素相对应的切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Unzip3)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Unzip3)] [[play](https://go.dev/play/p/bba4cpAa7KO)] - **Tuple4** : 4 元元组 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple4)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple4)] [[play](https://go.dev/play/p/D2EqDz096tk)] - **Tuple4_Unbox** : 返回 4 元元组的字段值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple4_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple4_Unbox)] [[play](https://go.dev/play/p/ACj9YuACGgW)] - **Zip4** : 创建一个 Tuple4 元组切片, 其中元组的元素和传入切片元素相对应。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Zip4)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Zip4)] [[play](https://go.dev/play/p/PEmTYVK5hL4)] - **Unzip4** : 根据传入的 Tuple4 切片,创建一组和 Tuple4 元素相对应的切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Unzip4)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Unzip4)] [[play](https://go.dev/play/p/rb8z4gyYSRN)] - **Tuple5** : 5 元元组 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple5)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple5)] [[play](https://go.dev/play/p/2WndmVxPg-r)] - **Tuple5_Unbox** : 返回 5 元元组的字段值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple5_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple5_Unbox)] [[play](https://go.dev/play/p/GyIyZHjCvoS)] - **Zip5** : 创建一个 Tuple5 元组切片, 其中元组的元素和传入切片元素相对应。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Zip5)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Zip5)] [[play](https://go.dev/play/p/fCAAJLMfBIP)] - **Unzip5** : 根据传入的 Tuple5 切片,创建一组和 Tuple5 元素相对应的切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Unzip5)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Unzip5)] [[play](https://go.dev/play/p/gyl6vKfhqPb)] - **Tuple6** : 6 元元组 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple6)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple6)] [[play](https://go.dev/play/p/VjqcCwEJZbs)] - **Tuple6_Unbox** : 返回 6 元元组的字段值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple6_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple6_Unbox)] [[play](https://go.dev/play/p/FjIHV7lpxmW)] - **Zip6** : 创建一个 Tuple6 元组切片, 其中元组的元素和传入切片元素相对应。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Zip6)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Zip6)] [[play](https://go.dev/play/p/oWPrnUYuFHo)] - **Unzip6** : 根据传入的 Tuple6 切片,创建一组和 Tuple6 元素相对应的切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Unzip6)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Unzip6)] [[play](https://go.dev/play/p/l41XFqCyh5E)] - **Tuple7** : 7 元元组 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple7)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple7)] [[play](https://go.dev/play/p/dzAgv_Ezub9)] - **Tuple7_Unbox** : 返回 7 元元组的字段值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple7_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple7_Unbox)] [[play](https://go.dev/play/p/R9I8qeDk0zs)] - **Zip7** : 创建一个 Tuple7 元组切片, 其中元组的元素和传入切片元素相对应。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Zip7)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Zip7)] [[play](https://go.dev/play/p/WUJuo897Egf)] - **Unzip7** : 根据传入的 Tuple7 切片,创建一组和 Tuple7 元素相对应的切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Unzip7)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Unzip7)] [[play](https://go.dev/play/p/hws_P1Fr2j3)] - **Tuple8** : 8 元元组 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple8)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple8)] [[play](https://go.dev/play/p/YA9S0rz3dRz)] - **Tuple8_Unbox** : 返回 8 元元组的字段值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple8_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple8_Unbox)] [[play](https://go.dev/play/p/PRxLBBb4SMl)] - **Zip8** : 创建一个 Tuple8 元组切片, 其中元组的元素和传入切片元素相对应。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Zip8)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Zip8)] [[play](https://go.dev/play/p/8V9jWkuJfaQ)] - **Unzip8** : 根据传入的 Tuple8 切片,创建一组和 Tuple8 元素相对应的切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Unzip8)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Unzip8)] [[play](https://go.dev/play/p/1SndOwGsZB4)] - **Tuple9** : 9 元元组 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple9)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple9)] [[play](https://go.dev/play/p/yS2NGGtZpQr)] - **Tuple9_Unbox** : 返回 9 元元组的字段值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple9_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple9_Unbox)] [[play](https://go.dev/play/p/oFJFGTAuOa8)] - **Zip9** : 创建一个 Tuple9 元组切片, 其中元组的元素和传入切片元素相对应。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Zip9)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Zip9)] [[play](https://go.dev/play/p/cgsL15QYnfz)] - **Unzip9** : 根据传入的 Tuple9 切片,创建一组和 Tuple9 元素相对应的切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Unzip9)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Unzip9)] [[play](https://go.dev/play/p/91-BU_KURSA)] - **Tuple10** : 10 元元组 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple10)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple10)] [[play](https://go.dev/play/p/799qqZg0hUv)] - **Tuple10_Unbox** : 返回 10 元元组的字段值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Tuple10_Unbox)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Tuple10_Unbox)] [[play](https://go.dev/play/p/qfyx3x_X0Cu)] - **Zip10** : 创建一个 Tuple10 元组切片, 其中元组的元素和传入切片元素相对应。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Zip10)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Zip10)] [[play](https://go.dev/play/p/YSR-2cXnrY4)] - **Unzip10** : 根据传入的 Tuple10 切片,创建一组和 Tuple10 元素相对应的切片。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/tuple_zh-CN.md#Unzip10)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/tuple.md#Unzip10)] [[play](https://go.dev/play/p/-taQB6Wfre_z)]

24. validator 验证器包,包含常用字符串格式验证函数。       回到目录

@@ -1735,103 +1735,103 @@ import "github.com/duke-git/lancet/v2/validator" #### 函数列表: - **ContainChinese** : 验证字符串是否包含中文字符。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#ContainChinese)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#ContainChinese)] [[play](https://go.dev/play/p/7DpU0uElYeM)] - **ContainLetter** : 验证字符串是否包含至少一个英文字母。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#ContainLetter)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#ContainLetter)] [[play](https://go.dev/play/p/lqFD04Yyewp)] - **ContainLower** : 验证字符串是否包含至少一个英文小写字母。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#ContainLower)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#ContainLower)] [[play](https://go.dev/play/p/Srqi1ItvnAA)] - **ContainUpper** : 验证字符串是否包含至少一个英文大写字母。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#ContainUpper)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#ContainUpper)] [[play](https://go.dev/play/p/CmWeBEk27-z)] - **IsAlpha** : 验证字符串是否只包含英文字母。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsAlpha)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsAlpha)] [[play](https://go.dev/play/p/7Q5sGOz2izQ)] - **IsAllUpper** : 验证字符串是否全是大写英文字母。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsAllUpper)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsAllUpper)] [[play](https://go.dev/play/p/ZHctgeK1n4Z)] - **IsAllLower** : 验证字符串是否全是小写英文字母。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsAllLower)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsAllLower)] [[play](https://go.dev/play/p/GjqCnOfV6cM)] - **IsBase64** : 验证字符串是否是 base64 编码。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsBase64)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsBase64)] [[play](https://go.dev/play/p/sWHEySAt6hl)] - **IsChineseMobile** : 验证字符串是否是中国手机号码。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsChineseMobile)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsChineseMobile)] [[play](https://go.dev/play/p/GPYUlGTOqe3)] - **IsChineseIdNum** : 验证字符串是否是中国身份证号码。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsChineseIdNum)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsChineseIdNum)] [[play](https://go.dev/play/p/d8EWhl2UGDF)] - **IsChinesePhone** : 验证字符串是否是中国电话座机号码(xxx-xxxxxxxx or xxxx-xxxxxxx.)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsChinesePhone)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsChinesePhone)] [[play](https://go.dev/play/p/RUD_-7YZJ3I)] - **IsCreditCard** : 验证字符串是否是信用卡号码。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsCreditCard)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsCreditCard)] [[play](https://go.dev/play/p/sNwwL6B0-v4)] - **IsDns** : 验证字符串是否是有效 dns。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsDns)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsDns)] [[play](https://go.dev/play/p/jlYApVLLGTZ)] - **IsEmail** : 验证字符串是否是有效电子邮件地址。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsEmail)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsEmail)] [[play](https://go.dev/play/p/Os9VaFlT33G)] - **IsEmptyString** : 验证字符串是否是空字符串。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsEmptyString)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsEmptyString)] [[play](https://go.dev/play/p/dpzgUjFnBCX)] - **IsFloat** : 验证参数是否是浮点数((float32,float34)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsFloat)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsFloat)] [[play](https://go.dev/play/p/vsyG-sxr99_Z)] - **IsFloatStr** : 验证字符串是否是可以转换为浮点数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsFloatStr)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsFloatStr)] [[play](https://go.dev/play/p/LOYwS_Oyl7U)] - **IsNumber** : 验证参数是否是数字(integer,float)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsNumber)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsNumber)] [[play](https://go.dev/play/p/mdJHOAvtsvF)] - **IsNumberStr** : 验证字符串是否是可以转换为数字。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsNumberStr)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsNumberStr)] [[play](https://go.dev/play/p/LzaKocSV79u)] - **IsJSON** : 验证字符串是否是有效 json。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsJSON)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsJSON)] [[play](https://go.dev/play/p/8Kip1Itjiil)] - **IsRegexMatch** : 验证字符串是否可以匹配正则表达式。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsRegexMatch)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsRegexMatch)] [[play](https://go.dev/play/p/z_XeZo_litG)] - **IsInt** : 验证参数是否是整数(int, unit)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsInt)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsInt)] [[play](https://go.dev/play/p/eFoIHbgzl-z)] - **IsIntStr** : 验证字符串是否是可以转换为整数。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIntStr)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsIntStr)] [[play](https://go.dev/play/p/jQRtFv-a0Rk)] - **IsIp** : 验证字符串是否是 ip 地址。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIp)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsIp)] [[play](https://go.dev/play/p/FgcplDvmxoD)] - **IsIpV4** : 验证字符串是否是 ipv4 地址。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIpV4)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsIpV4)] [[play](https://go.dev/play/p/zBGT99EjaIu)] - **IsIpV6** : 验证字符串是否是 ipv6 地址。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIpV6)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsIpV6)] [[play](https://go.dev/play/p/AHA0r0AzIdC)] - **IsStrongPassword** : 验证字符串是否是强密码:(字母+数字+特殊字符)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsStrongPassword)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsStrongPassword)] [[play](https://go.dev/play/p/QHdVcSQ3uDg)] - **IsUrl** : 验证字符串是否是 url。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsUrl)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsUrl)] [[play](https://go.dev/play/p/pbJGa7F98Ka)] - **IsWeakPassword** : 验证字符串是否是弱密码(只包含字母+数字)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsWeakPassword)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsWeakPassword)] [[play](https://go.dev/play/p/wqakscZH5gH)] - **IsZeroValue** : 判断传入的参数值是否为零值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsZeroValue)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsZeroValue)] [[play](https://go.dev/play/p/UMrwaDCi_t4)] - **IsGBK** : 检查数据编码是否为 gbk(汉字内部代码扩展规范)。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsGBK)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsGBK)] [[play](https://go.dev/play/p/E2nt3unlmzP)] - **IsASCII** : 验证字符串全部为 ASCII 字符。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsASCII)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsASCII)] [[play](https://go.dev/play/p/hfQNPLX0jNa)] - **IsPrintable** : 检查字符串是否全部为可打印字符。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsPrintable)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/validator.md#IsPrintable)] [[play](https://go.dev/play/p/Pe1FE2gdtTP)]

25. xerror 包实现一些错误处理函数。       回到目录

@@ -1843,43 +1843,43 @@ import "github.com/duke-git/lancet/v2/xerror" #### 函数列表: - **New** : 创建 XError 对象实例。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#New)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#New)] [[play](https://go.dev/play/p/w4oWZts7q7f)] - **Wrap** : 根据 error 对象创建 XError 对象实例,可添加 message。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#Wrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#Wrap)] [[play](https://go.dev/play/p/5385qT2dCi4)] - **Unwrap** : 从 error 对象中解构出 XError。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#Unwrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#Unwrap)] [[play](https://go.dev/play/p/LKMLep723tu)] - **XError_Wrap** : 创建新的 XError 对象并将消息和 id 复制到新的对象中。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#XError_Wrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Wrap)] [[play](https://go.dev/play/p/RpjJ5u5sc97)] - **XError_Unwrap** : 解构 XEerror 为 error 对象。适配 github.com/pkg/errors。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#XError_Unwrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Unwrap)] [[play](https://go.dev/play/p/VUXJ8BST4c6)] - **XError_With** : 添加与 XError 对象的键和值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#XError_With)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_With)] [[play](https://go.dev/play/p/ow8UISXX_Dp)] - **XError_Id** : 设置 XError 对象的 id。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#XError_Id)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Id)] [[play](https://go.dev/play/p/X6HBlsy58U9)] - **XError_Is** : 检查目标 error 是否为 XError,两个错误中的 error.id 是否匹配。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#XError_Is)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Is)] [[play](https://go.dev/play/p/X6HBlsy58U9)] - **XError_Values** : 返回由 With 设置的键和值的映射。将合并所有 XError 键和值。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#XError_Values)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Values)] [[play](https://go.dev/play/p/ow8UISXX_Dp)] - **XError_StackTrace** : 返回与 pkg/error 兼容的堆栈信息。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#XError_StackTrace)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_StackTrace)] [[play](https://go.dev/play/p/6FAvSQpa7pc)] - **XError_Info** : 返回可打印的 XError 对象信息。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#XError_Info)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Info)] [[play](https://go.dev/play/p/1ZX0ME1F-Jb)] - **XError_Error** : 实现标准库的 error 接口。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#XError_Error)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#XError_Error)] [[play](https://go.dev/play/p/w4oWZts7q7f)] - **TryUnwrap** : 检查 error, 如果 err 为 nil 则展开,则它返回一个有效值,如果 err 不是 nil 则 Unwrap 使用 err 发生 panic。 - [[doc](https://github.com/duke-git/lancet/blob/main/docs/xerror_zh-CN.md#TryUnwrap)] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/api/packages/xerror.md#TryUnwrap)] [[play](https://go.dev/play/p/acyZVkNZEeW)] ## 如何贡献代码