utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IsWindows = false
)
View Source
var TempFileNames = []string{}

Functions

func CheckRoot

func CheckRoot(quiet bool)

func ExecCommand

func ExecCommand(command string) *exec.Cmd

func Exists

func Exists(path string) bool

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

func HomeDir

func HomeDir() (string, error)

func IsDir

func IsDir(path string) bool

判断所给路径是否为文件夹

func IsFile

func IsFile(path string) bool

判断所给路径是否为文件

func RemoveFile

func RemoveFile(path string) error

删除文件

func StringEllipsis

func StringEllipsis(str string, length int) string

func TempFile

func TempFile() (*os.File, error)

生成临时文件

func WriteFile

func WriteFile(path string, data []byte) error

写入文件

Types

This section is empty.

Jump to

Keyboard shortcuts

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