tools

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileInfo added in v0.0.7

func GetFileInfo(path string) (os.FileInfo, error)

GetFileInfo returns file information for the given path

func GetFileModTime

func GetFileModTime(path string) int64

GetFileModTime returns unix timestamp of `os.File.ModTime` for the given path with caching

func GetPathDir

func GetPathDir(path string, contain []string) []string

func GetVailDir

func GetVailDir(paths []string, contain []string) []string

func InArray

func InArray(in string, arr []string) bool

func IsDir

func IsDir(dir string) bool

IsDir returns true if given path is a directory, and returns false when it's a file or does not exist.

func IsExist

func IsExist(path string) bool

IsExist returns true if a file or directory exists.

func IsFile

func IsFile(path string) bool

IsFile returns true if given path exists as a file (i.e. not a directory).

func IsGoP added in v0.0.7

func IsGoP() bool

func IsRustP added in v0.0.7

func IsRustP() bool

func Md5

func Md5(s string) string

func Md5Byte

func Md5Byte(buf []byte) string

func ReadFile

func ReadFile(file string) (string, error)

func RunCommand added in v0.0.7

func RunCommand(command string, args ...string) (string, error)

RunCommand executes a shell command and returns the output

func WriteFile

func WriteFile(file string, content string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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