rtool

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAllSpace

func DeleteAllSpace(s string) string

DeleteAllSpace 删除掉空格,tab,回车,换行

func DeletePrev0

func DeletePrev0(s string) string

DeletePrev0 删除掉前面的0,或多个0

func RetryFunc

func RetryFunc(maxBout int, sleepTime time.Duration, ptLog bool, fx func() (bool, error)) (err error)

RetryFunc 如果函数运行失败则重试,如果函数运行成功则结束 maxBout:最大重试次数 sleepTime:重试间隔时间 ptLog:是否打印错误日志 fx:要执行的函数,函数返回值1:是否继续重试至最大次数;函数返回值2:错误信息 返回值:错误信息

func RetryFuncErr

func RetryFuncErr(maxBout int, sleepTime time.Duration, ptLog bool, fx func() error) (err error)

RetryFuncErr 如果函数运行失败则重试,如果函数运行成功则结束 maxBout:最大重试次数 sleepTime:重试间隔时间 ptLog:是否打印错误日志 fx:要执行的函数,函数返回值1:是否继续重试至最大次数;函数返回值2:错误信息 返回值:错误信息

Types

This section is empty.

Jump to

Keyboard shortcuts

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