util

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckProcessExist

func CheckProcessExist(pid int) bool

func CopyFile added in v1.0.0

func CopyFile(source, destination string) error

CopyFile 将一个目录复制到另外一个目录中

func CopyFolder added in v1.0.0

func CopyFolder(source, destination string) error

CopyFolder 将一个目录复制到另外一个目录中

func CreateFileTemlate

func CreateFileTemlate(folderNeedCreate bool, folderPath string, file string, tmp string, data interface{}) error

folderNeedCreate 表明路径是否需要创建 folderPath/file 确定了目标文件的路径 tmp 为模板字符串, data为数据

func DownloadFile

func DownloadFile(filepath string, url string) error

DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.

func Exists

func Exists(path string) bool

判断所给路径文件/文件夹是否存在

func GetExecDirectory

func GetExecDirectory() string

GetExecDirectory 获取当前执行程序目录

func IsHiddenDirectory

func IsHiddenDirectory(path string) bool

路径是否是隐藏路径

func KillPid added in v1.0.0

func KillPid(pid int) error

func PrettyPrint

func PrettyPrint(arr [][]string)

PrettyPrint 美观输出数组

func RebuildApp added in v1.0.0

func RebuildApp() error

func SubDir

func SubDir(folder string) ([]string, error)

输出所有子目录,目录名

func Unzip

func Unzip(src string, dest string) ([]string, error)

Unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2).

Types

This section is empty.

Jump to

Keyboard shortcuts

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