utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackupFile added in v1.0.4

func BackupFile(srcPath string) error

备份文件

func Error

func Error(format string, a ...interface{}) (n int, err error)

func ExecShell

func ExecShell(command string) (string, error)

func FileExt

func FileExt(filename string) string

func GetAllFiles added in v1.1.0

func GetAllFiles(dirPath string, exts []string) ([]string, error)

获取指定目录下的所有文件或目录 如果exts为空,则获取所有文件和目录 如果exts包含"*",则获取所有文件 如果exts不包含"*",但包含其他字符,则获取对应格式名的文件

func GetDirFiles added in v1.0.1

func GetDirFiles(dir string, exts []string) ([]string, error)

获取指定目录下的某些格式的文件列表

func GetFileName added in v1.0.2

func GetFileName(filePath string) string

获取文件名

func GetFilesName added in v1.0.4

func GetFilesName(filesPath ...string) (filesName []string)

批量获取文件名

func GetVersion added in v1.1.0

func GetVersion() string

func IsAbsolutePath added in v1.0.4

func IsAbsolutePath(pathName string) bool

func IsURL

func IsURL(input string) bool

检查是否为URL

func MergeSlices added in v1.1.0

func MergeSlices(slice1, slice2 []string) []string

func Message

func Message(format string, a ...interface{}) (n int, err error)

func PathExists

func PathExists(path string) (bool, error)

func SliceContain added in v1.1.0

func SliceContain(slice []string, target string) bool

func SliceContains added in v1.1.0

func SliceContains(slice []string, targets []string) bool

func SliceRemove added in v1.1.0

func SliceRemove(sliceString []string, item string) []string

func SliceRemoves added in v1.1.0

func SliceRemoves(sliceString []string, removeList []string) []string

func Success

func Success(format string, a ...interface{}) (n int, err error)

func UUID

func UUID() string

func UUIDhex added in v1.0.2

func UUIDhex() string

func Warning

func Warning(format string, a ...interface{}) (n int, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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