helpers

package
v0.0.0-...-94f6560 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvNumToBase62

func ConvNumToBase62(num uint) string

convert a number to a base62 string

func CurrentTimestampStr

func CurrentTimestampStr() string

func Empty

func Empty(val interface{}) bool

func FillHttpScheme

func FillHttpScheme(url string) string

func FirstElement

func FirstElement(args []string) string

FirstElement 安全地获取 args[0],避免 panic: runtime error: index out of range

func GenerateTraceID

func GenerateTraceID() string

func MicrosecondsStr

func MicrosecondsStr(elapsed time.Duration) string

MicrosecondsStr 将 time.Duration 类型(nano seconds 为单位) 输出为小数点后 3 位的 ms (microsecond 毫秒,千分之一秒)

func RandomNumber

func RandomNumber(length int) string

RandomNumber 生成长度为 length 随机数字字符串

func RandomString

func RandomString(length int) string

RandomString 生成长度为 length 的随机字符串

func ToJson

func ToJson(a any, indent bool) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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