Documentation ¶
Index ¶
- Constants
- func Boom(remark string)
- func FindFilePaths(root string, pattern string) ([]string, error)
- func GetTimeVersion() string
- func InElems[T comparable](elem T, elems []T) bool
- func JoinElems[T comparable](elems []T, sep string) string
- func MustGetFilePath(path string) string
- func Negative[T int | int32 | int64 | float32 | float64](money T) T
- func PagingElems[T interface{}](elems []T, page int, size int) []T
- func Positive[T int | int32 | int64 | float32 | float64](money T) T
- func ProcessStringsSlice(strs []string, filter func(string) bool, fn func(string) string) []string
- func ShardingElems[T comparable](elems []T, batchSize int) (batches [][]T)
- func TimestampToLayout(timestamp int64, layout string) string
- func ToFen(amount float64) int64
- func ToIntYuan(y int64) int64
- func ToJsonString(v interface{}, pretty bool) string
- func ToYuan(o int64) float64
- func UniqElems[T comparable](elems []T) []T
- type StdDateStr
- type StdDateTimeStr
Constants ¶
View Source
const ( StdDataLayout = `2006-01-02` StdDateTimeLayout = `2006-01-02 15:04:05` StdCompactDateLayout = `20060102` StdCompactDateTimeLayout = `20060102150405` )
Variables ¶
This section is empty.
Functions ¶
func FindFilePaths ¶
FindFilePaths 寻找文件dir的目录下有多少md文件
func JoinElems ¶
func JoinElems[T comparable](elems []T, sep string) string
JoinElems 对elems进行sep字符拼接,比如SQl场景等
func MustGetFilePath ¶
MustGetFilePath 如果改路径不存在,则自动创建,若存在,则直接返回对应的路径名
func PagingElems ¶
PagingElems 从elems切片中,按每页size大小,获取page页的数据
func ProcessStringsSlice ¶
ProcessStringsSlice 返回值为自定义处理函数针对切片每个元素进行处理后,返回新的切片内容
func ShardingElems ¶
func ShardingElems[T comparable](elems []T, batchSize int) (batches [][]T)
ShardingElems 对elems 按批次大小batchSize分片
func TimestampToLayout ¶
TimestampToLayout 整型时间戳转成指定类型的时间字符串
func ToJsonString ¶
ToJsonString 将变量转成Json类型,主要for debug
Types ¶
Click to show internal directories.
Click to hide internal directories.