util

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KillByname func(name string)
	KillByPid  func(pid string)
)
View Source
var (
	WorkingDirectory = workingDirectory()
	ExecuteDirectory = executorDirectory()
	TempDirectory    = os.TempDir()
	StringBuilder    = strings.Builder{}
)
View Source
var (
	CreateCommand func(command string) *exec.Cmd
)

Functions

func AbsPath added in v0.1.5

func AbsPath(file_ string) string

// e.g. // a.txt -> /home/xxx/a.txt // Makefile -> D:/SOFT/CODE/Makefile

func CopyFile added in v0.1.5

func CopyFile(src string, dst string)

func CreatFile added in v0.1.5

func CreatFile(src string, data string)

func DeleteFile added in v0.1.5

func DeleteFile(src string)

func DisableInterpret added in v0.1.5

func DisableInterpret()

func ExecuteCommand added in v0.1.4

func ExecuteCommand(command string) int

func ExecuteCommandResult added in v0.1.4

func ExecuteCommandResult(command string) string

func ExecuteCommandSilent added in v0.1.4

func ExecuteCommandSilent(command string) int

func ExecuteCommandSilentResult added in v0.1.4

func ExecuteCommandSilentResult(command string) string

func IsDir added in v0.1.5

func IsDir(file_ string) bool

func IsExist added in v0.1.5

func IsExist(file_ string) bool

func IsFile added in v0.1.5

func IsFile(file_ string) bool

func Map

func Map[T any](array []T, callback func(T) T) []T

func NewDebounce

func NewDebounce(interval time.Duration) func(f func())

func NewThrottle

func NewThrottle(interval time.Duration) func(f func())

func ReadAll added in v0.1.5

func ReadAll(src string) string

func ReadDir added in v0.1.5

func ReadDir(src string) ([]string, []string)

func SetAppend

func SetAppend(set map[string]struct{}, files []string)

func WslPathConvent added in v0.1.5

func WslPathConvent(path string) string

cover windows path to wsl path D:\soft\code --> /mnt/d/soft/code

Types

This section is empty.

Jump to

Keyboard shortcuts

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