util

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EXECUTE_PATH = ExecutePath()
	CMD_PATH     = CmdPath()
)

Functions

func AbsPath

func AbsPath(file_ string) string

AbsPath 返回文件的绝对路径 移除错误处理 e.g. a.txt -> /home/xxx/a.txt Makefile -> D:/SOFT/CODE/Makefile

func CmdPath

func CmdPath() string

获取当前命令窗口的路径 移除错误处理 e.g. CmdPath() -> /home/xxx CmdPath() -> D:/SOFT/CODE

func CopyFile

func CopyFile(src string, dst string)

func CreatFile

func CreatFile(src string, data string)

func DeleteFile

func DeleteFile(src string)

func Execute

func Execute(command string) int

func ExecutePath

func ExecutePath() string

返回可执行文件的路径 不包含可执行文件 不会因为在哪里运行而改变 起到了类似于 ./ 的作用

func ExecuteSilent added in v0.0.2

func ExecuteSilent(command string) int

func FileLogger

func FileLogger(src string)

func FileLoggerClose

func FileLoggerClose()

func FileLoggerPrintln

func FileLoggerPrintln(v ...interface{})

func ReadAll

func ReadAll(src string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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