Documentation ¶
Index ¶
- func Bool(i interface{}) bool
- func DiffNatureDays(t1, t2 int64) int
- func Div(Num int) string
- func DockerRunCommand(command string) (err error)
- func Float64(any interface{}) float64
- func InArray(value string, arr []string) bool
- func Int(any interface{}) int
- func Int64(any interface{}) int64
- func LeDecodeToFloat64(b []byte) float64
- func LeFillUpSize(b []byte, l int) []byte
- func LogField(err error, msg string) log.Fields
- func Md5(str string) string
- func PathExists(path string) (bool, error)
- func ReserveNumber(f float64, m int) string
- func Round(f float64, n int) float64
- func RunCommand(name string, arg ...string) (err error)
- func String(any interface{}) string
- func UnExt(fileName string) string
- func UnzipDir(zipFile, dir string)
- func VersionCompare(v1, v2 string) (res bool)
- func WriteFile(fileName, s string) (err error)
- type Host
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
func Bool(i interface{}) bool
Bool @description: 转换为bool类型 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/12/27 14:40 @success:
func DiffNatureDays ¶
DiffNatureDays @description: 两个日期的相差的自然天数 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/11/16 11:22 @success:
func DockerRunCommand ¶
DockerRunCommand @description: docker容器执行宿主机指令 @param: @author: GJing @email: gjing1st@gmail.com @date: 2023/2/11 13:46 @success:
func Float64 ¶
func Float64(any interface{}) float64
Float64 @description: 接口类型转float64 @param: any 接口类型 @author: GJing @email: guojing@tna.cn @date: 2022/4/22 10:44 @success: float64
func InArray ¶
InArray @description: 判断一个字符串是否在数组中 @param: @author: GJing @email: gjing1st@gmail.com @date: 2020/11/13 14:42 @success:
func Int ¶
func Int(any interface{}) int
Int @description: 转int @param: @author: GJing @email: guojing@tna.cn @date: 2022/4/22 11:13 @success:
func Int64 ¶
func Int64(any interface{}) int64
Int64 @description: 接口类型转int64 @param: any 接口类型 @author: GJing @email: guojing@tna.cn @date: 2022/4/22 10:56 @success: int64
func LeDecodeToFloat64 ¶
func LeFillUpSize ¶
func LogField ¶
LogField @description: 日志字段 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/11/1 15:35 @success:
func PathExists ¶
PathExists @description: 判断文件是否存在 @param: @author: Zq @email: zhengqiang@tna.cn @date: 2022/10/19 17:52 @success:
func ReserveNumber ¶
ReserveNumber @description: 截取保留小数点后m位,舍去后面位数 @param: f float64 @param: m 保留的位数 @author: GJing @email: gjing1st@gmail.com @date: 2020/11/25 上午 10:31 @success: 返回截取后的字符串
func Round ¶
Round @description: 四舍五入保留n位小数 @param:f 需要处理的float数 @param:n 需要保留的小数位数 @author: GJing @email: gjing1st@gmail.com @date: 2021/1/23 10:36 @success:
func RunCommand ¶
RunCommand @description: 运行系统命令 @param: cmdStr 要运行的命令 @author: GJing @email: guojing@tna.cn @date: 2022/9/2 17:46 @success:
func String ¶
func String(any interface{}) string
String @description: 转string类型 @param: any 接口类型 @author: GJing @email: guojing@tna.cn @date: 2022/4/22 11:11 @success: 字符串
func UnExt ¶
UnExt @description: 返回文件名称去掉后缀和最后一个`.` @param: fileName 文件名称 @author: GJing @email: guojing@tna.cn @date: 2022/7/28 15:39 @success:
func UnzipDir ¶
func UnzipDir(zipFile, dir string)
UnzipDir @description: 解压缩 @param:zipFile 压缩文件路径 ./test.zip @param:dir 需要解压到的指定文件夹目录 ex :F:\dumps_copy @author: GJing @email: gjing1st@gmail.com @date: 2021/1/13 15:19 @success:
func VersionCompare ¶
VersionCompare @description: 版本比较,v2版本是否大于v1版本 @param: v1 string 当前版本 @param: v2 string 最新版本 @author: GJing @email: gjing1st@gmail.com @date: 2023/2/16 14:41 @success: v2>v1返回true