Documentation ¶
Index ¶
- Constants
- func CopyMap[K comparable, V any](src map[K]V) (dst map[K]V)
- func CopySlice[T any](src []T) (dst []T)
- func DeduplicateSlice[T comparable](slice []T) (result []T)
- func FilterIntSlice(src []int, dst []int) (result []int)
- func FilterSlice[T comparable](src, dst []T) (result []T)
- func FilterStringSlice(src []string, dst []string) (result []string)
- func FormatURLParam(body map[string]any) (urlParam string)
- func IntDeduplicate(slice []int) (result []int)
- func IntIntersect(slice1, slice2 []int) (result []int)
- func IntMergeDeduplicate(slice1, slice2 []int) (result []int)
- func IntRemoveElement(slice []int, elem, n int) (result []int)
- func IntRemoveElementByIndex(slice []int, index int) (result []int)
- func IntUnion(slice1, slice2 []int) (result []int)
- func IntersectSlice[T comparable](slice1, slice2 []T) (result []T)
- func JoinInts(is []int64) string
- func MergeDeduplicateSlice[T comparable](slice1, slice2 []T) (result []T)
- func RandomNumber(l int) string
- func RandomPureString(l int) string
- func RandomString(l int) string
- func RemoveSliceElement[T comparable](slice []T, elem T, n int) (result []T)
- func RemoveSliceElementByIndex[T comparable](slice []T, index int) (result []T)
- func SplitInts(s string) ([]int64, error)
- func StringDeduplicate(slice []string) (result []string)
- func StringMergeDeduplicate(slice1, slice2 []string) (result []string)
- func StringRemoveElement(slice []string, elem string, n int) (result []string)
- func StringRemoveElementByIndex(slice []string, index int) (result []string)
- func UnionSlice[T comparable](slice1, slice2 []T) (result []T)
- func VerifyIDCard(idCard string) bool
- func VerifyPhoneNumber(phone string) bool
Constants ¶
const (
NULL = ""
)
Variables ¶
This section is empty.
Functions ¶
func CopyMap ¶
func CopyMap[K comparable, V any](src map[K]V) (dst map[K]V)
func FilterIntSlice ¶
Deprecated FilterIntSlice() is deprecated, please use FilterSlice() instead. 过滤数组,去除src在dst中存在的item src[1,2,3,4,5] dst[2,4,6,8] result[1,3,5]
func FilterSlice ¶
func FilterSlice[T comparable](src, dst []T) (result []T)
过滤数组,去除src在dst中存在的item src[1,2,3,4,5] dst[2,4,6,8] result[1,3,5] src["a","b","c","d","e"] dst["b","d","f","h"] result["a","c","e"]
func FilterStringSlice ¶
Deprecated FilterStringSlice() is deprecated, please use FilterSlice() instead. 过滤数组,去除src在dst中存在的item src["a","b","c","d","e"] dst["b","d","f","h"] result["a","c","e"]
func FormatURLParam ¶
func IntDeduplicate ¶
Deprecated IntDeduplicate() is deprecated, please use DeduplicateSlice() instead. int 数组去重
func IntIntersect ¶
Deprecated IntIntersect() is deprecated, please use IntersectSlice() instead. int 数组,slice1 和 slice2 交集
func IntMergeDeduplicate ¶
Deprecated IntMergeDeduplicate() is deprecated, please use MergeDeduplicateSlice() instead. int 数组合并+去重
func IntRemoveElement ¶
Deprecated IntRemoveElement() is deprecated, please use RemoveSliceElement() instead. int 数组,移除元素 If n < 0, there is no limit on the number of remove. return new slice
func IntRemoveElementByIndex ¶
Deprecated IntRemoveElementByIndex() is deprecated, please use RemoveSliceElementByIndex() instead. int 数组,根据index移除元素 return new slice
func IntUnion ¶
Deprecated IntUnion() is deprecated, please use UnionSlice() instead. int 数组,slice1 和 slice2 并集
func IntersectSlice ¶
func IntersectSlice[T comparable](slice1, slice2 []T) (result []T)
slice1 和 slice2 交集
func MergeDeduplicateSlice ¶
func MergeDeduplicateSlice[T comparable](slice1, slice2 []T) (result []T)
数组合并+去重
func RemoveSliceElement ¶
func RemoveSliceElement[T comparable](slice []T, elem T, n int) (result []T)
数组移除元素 If n < 0, there is no limit on the number of remove. return new slice
func RemoveSliceElementByIndex ¶
func RemoveSliceElementByIndex[T comparable](slice []T, index int) (result []T)
数组根据index移除元素 return new slice
func StringDeduplicate ¶
Deprecated StringDeduplicate() is deprecated, please use DeduplicateSlice() instead. string 数组去重
func StringMergeDeduplicate ¶
Deprecated StringMergeDeduplicate() is deprecated, please use MergeDeduplicateSlice() instead. string 数组合并+去重
func StringRemoveElement ¶
Deprecated string 数组,移除元素 If n < 0, there is no limit on the number of remove. return new slice
func StringRemoveElementByIndex ¶
Deprecated StringRemoveElementByIndex() is deprecated, please use RemoveSliceElementByIndex() instead. string 数组,根据index移除元素 return new slice
func UnionSlice ¶
func UnionSlice[T comparable](slice1, slice2 []T) (result []T)
string 数组,slice1 和 slice2 并集
func VerifyIDCard ¶
VerifyIDCard 计算规则参考“中国国家标准化管理委员会”官方文档:http://www.gb688.cn/bzgk/gb/newGbInfo?hcno=080D6FBF2BB468F9007657F26D60013E 身份证号码校验
Types ¶
This section is empty.