Documentation
¶
Overview ¶
Package util
Index ¶
- func ArrSplit[T any](arr []T, batchSize int) [][]T
- func BoolToStr(b bool) string
- func CharMerge[T char](s string, ch T) []T
- func Difference[T comparable](arr1 []T, arr2 []T) []T
- func ElemIn[T comparable](target T, arr []T) bool
- func EndWith(s string, sub string, ignoreCase bool) (found bool)
- func FloatToStr[T floatType](f T) string
- func GetMapValue[K comparable, V any](raw map[K]V, key K, def V) V
- func HumpFormatToUnderLine(s string) string
- func IntToStr[T intType](i T) string
- func Interface2Interface(data interface{}, obj interface{}) error
- func Interface2JSON(i interface{}) (string, error)
- func InterfaceToString(v interface{}) (ret string)
- func Intersection[T comparable](arr1 []T, arr2 []T) []T
- func JoinArr[T any](arr []T, linkStr string) string
- func Map2Bytes[K comparable, V any](m map[K]V) ([]byte, error)
- func Map2JSON[K comparable, V any](m map[K]V) (string, error)
- func MapHumpFormatToUnderLine[V any](raw map[string]V) map[string]V
- func MergeMap[K comparable, V any](data ...map[K]V) map[K]V
- func NumArrTransfer[T1 numType, T2 numType](arr []T1) []T2
- func ParamsSorted[V any](params map[string]V) string
- func RandomInt64(min, max int64) int64
- func SafeGo(f func())
- func StartWith(s string, sub string, ignoreCase bool) (found bool)
- func Str2Bool(s string) (bool, error)
- func Str2Float[T floatType](s string) (T, error)
- func Str2FloatArr[T floatType](s string, sep string) ([]T, error)
- func Str2Int[T intType](s string) (T, error)
- func Str2IntArr[T intType](s string, sep string) ([]T, error)
- func Str2Uint[T uintType](s string) (T, error)
- func StrSplit(s string, seq []string, trimSpace bool) ([]string, []string)
- func UintToStr[T uintType](i T) string
- func Union[T comparable](arr1 []T, arr2 []T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FloatToStr ¶
func FloatToStr[T floatType](f T) string
func GetMapValue ¶
func GetMapValue[K comparable, V any](raw map[K]V, key K, def V) V
GetMapValue 获取map数据
func HumpFormatToUnderLine ¶
HumpFormatToUnderLine 驼峰转下滑线命名
func Interface2Interface ¶
func Interface2Interface(data interface{}, obj interface{}) error
Interface2Interface 数据结构转换
func Interface2JSON ¶
func InterfaceToString ¶
func InterfaceToString(v interface{}) (ret string)
InterfaceToString 任意数据转string
func MapHumpFormatToUnderLine ¶
MapHumpFormatToUnderLine map key 驼峰转下滑线命名
func NumArrTransfer ¶
func NumArrTransfer[T1 numType, T2 numType](arr []T1) []T2
NumArrTransfer 数字型的数组转换
func RandomInt64 ¶
RandomInt64 returns, as an int64, a non-negative pseudo-random number in the half-open interval [min,max)
func Str2FloatArr ¶
func Str2IntArr ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.