file

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsInt added in v0.0.3

func ContainsInt(a []int, i int) bool

ContainsInt 是否包含整型元素

func ContainsInt64 added in v0.0.3

func ContainsInt64(a []int64, i int64) bool

ContainsInt64 是否包含整型元素

func ContainsString added in v0.0.3

func ContainsString(a []string, s string) bool

ContainsString 是否包含字符串元素

func CreateDir added in v0.0.3

func CreateDir(dirs ...string) (err error)

CreateDir 批量创建文件夹

func FileExist

func FileExist(file string) bool

FileExist 判断文件是否存在及是否有权限访问

func InStringSlice added in v0.0.7

func InStringSlice(slice []string, element string) bool

InStringSlice 字符串是否在字符切片中

func Int64Unique added in v0.0.3

func Int64Unique(a []int64) []int64

Int64Unique 去重

func IsRunning added in v0.0.3

func IsRunning(pid int) bool

IsRunning 通过pid判断进程是否运行中

func PathExists added in v0.0.3

func PathExists(path string) (bool, error)

PathExists 文件目录是否存在

func ReadFromFile added in v0.0.3

func ReadFromFile(filename string) (int, error)

ReadFromFile 从文件中读取pid

func Remove added in v0.0.3

func Remove(a []string, s string) []string

Remove 移除元素

func RemoveEmptyString added in v0.0.3

func RemoveEmptyString(a []string) []string

RemoveEmptyString 移除空字符串

func ReplaceStrings added in v0.0.3

func ReplaceStrings(s string, old []string, replace []string) string

ReplaceStrings 批量替换字符串

func StringUnique added in v0.0.3

func StringUnique(a []string) []string

StringUnique 去重

func WorkDir added in v0.0.3

func WorkDir() (string, error)

WorkDir 获取程序运行时根目录

func WriteToFile added in v0.0.3

func WriteToFile(filename string, pids ...int) error

WriteToFile 写入pid到文件中

Types

This section is empty.

Jump to

Keyboard shortcuts

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