utils

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Red color = iota
	Green
	BrightBlue
	Magenta // 紫色
	Cyan    // 青色
)

Variables

This section is empty.

Functions

func DelayDo added in v0.20.0

func DelayDo(d time.Duration, fn func())

func GetNextColor added in v0.18.0

func GetNextColor() color

func Hold added in v0.23.0

func Hold()

func IsDev

func IsDev() bool

func IsDigits added in v0.20.0

func IsDigits(s string) bool

func IsNil added in v0.19.0

func IsNil[T any](v T) bool

IsNil returns true if v is a nil value for nilable kinds or an untyped nil interface.

func LogMessage

func LogMessage(message string)

func PPrint added in v0.21.0

func PPrint(obj interface{})

PPrint 格式化打印任意对象

func PrintlnColor added in v0.18.0

func PrintlnColor(c color, text string)

PrintlnColor 输出彩色文字并换行

func RetryWork

func RetryWork(work func() error, retryTimes int)

RetryWork 执行工作函数,捕获panic或error并最多重试retryTimes次 work: 需要执行的工作函数 retryTimes: 最大重试次数(不包括首次执行)

Types

This section is empty.

Jump to

Keyboard shortcuts

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