tool

package
v0.0.0-...-e3d587c Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDir

func CreateDir(path string, all bool) error

创建目录

func DirExists

func DirExists(path string) bool

检验目录是否存在

func DirFormatGang

func DirFormatGang() string

自动判断系统并返回使用的路径斜杠格式

func FileFormatPath

func FileFormatPath(fp string) string

自动判断系统并返回使用的路径

func GetAppRootDir

func GetAppRootDir() string

获取应用根目录

func GetFileBaseName

func GetFileBaseName(filepath string) string

获取文件名称(不带后缀)

func GetIntRandomNumber

func GetIntRandomNumber(min int64, max int64) int64

获取某范围的随机整数

func GetNowDateTime

func GetNowDateTime() string

func GetRandomCodeString

func GetRandomCodeString(len int) string

获取随机字符串

func GetTimestampDateTimeString

func GetTimestampDateTimeString(timeStamp int64) string

func InSliceString

func InSliceString(s string, slices []string) bool

验证 s 是否存在 slice 中

func LinuxDir

func LinuxDir(dir string) string

Windows下Dir路径统一Linux格式

func Md5String

func Md5String(str string) string

文本md5

func PathAddGang

func PathAddGang(s string) string

自动给路径尾部没有斜杠的字符串加上斜杠并转本系统写法

func RepeatStr

func RepeatStr(str string, s string, length int, before bool) string

func SetRandomSeed

func SetRandomSeed()

设置随机种子

func VaildFile

func VaildFile(file string) bool

校验文件是否存在

func WinDir

func WinDir(dir string) string

Linux下Dir路径统一Windows格式

Types

This section is empty.

Jump to

Keyboard shortcuts

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