util

package
v0.0.0-...-4450499 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneMessage

func CloneMessage[E proto.Message](e E) E

proto.Clone(e).(*pb.Xxx)

func DayCount

func DayCount(a time.Time, b time.Time) int

2个日期的相隔天数

func DeleteOne

func DeleteOne[S ~[]E, E comparable](s S, delELem E) S

只删除slice的一个元素

func DeleteOneFunc

func DeleteOneFunc[S ~[]E, E any](s S, del func(E) bool) S

只删除slice的一个元素

func GetTimeoutTimestamp

func GetTimeoutTimestamp(timeType, timeout int32, now time.Time) int32

计算超时时间戳

func IsMultiOverflow

func IsMultiOverflow(a, b int32) bool

乘法结果是否数值溢出

func ToBool

func ToBool(v any) bool

func ToDate

func ToDate(t time.Time) time.Time

去除Time中的时分秒,只保留日期

func ToDateInt

func ToDateInt(t time.Time) int32

转换成20240219格式

func ToFloat

func ToFloat(v any) float64

func ToInt

func ToInt(v any) int

func ToUint

func ToUint(v any) uint

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL