utils

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src, dst string) error

CopyDir 复制整个目录

func CopyFile

func CopyFile(src, dst string) error

CopyFile 复制单个文件

func CopyWithWildcard

func CopyWithWildcard(srcPattern, dst string) error

CopyWithWildcard 支持通配符的目录复制

func ExistsFile

func ExistsFile(path string) bool

func Fatal

func Fatal(prompt string, errs ...error)

func FindDirContainingFiles

func FindDirContainingFiles(srcDir string, repoIdentifyFiles []string, skipDirs ...string) (string, error)

FindDirContainingFiles 查找包含指定文件的目录, 返回目录名

func GetInput

func GetInput(prompt string, defaults ...string) string

GetInput 获取字符串输入

func GetLocalIP

func GetLocalIP() (string, error)

func GetRootGolangModule

func GetRootGolangModule() (string, error)

func IsDir

func IsDir(path string) (string, error)

IsDir 检查路径是否为目录

func IsDirReadableAndWithFiles

func IsDirReadableAndWithFiles(path, fileSuffix string) error

IsDirReadableAndWithFiles 检查目录是否可读

func IsDirWritable

func IsDirWritable(path string) error

IsDirWritable 检查目录是否可写

func IsValidRelativePath

func IsValidRelativePath(path string) bool

IsValidRelativePath 检查路径是否为有效的相对路径 允许当前目录("."),但不允许上级目录("..")

Types

This section is empty.

Jump to

Keyboard shortcuts

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