file

package
v0.10.8 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddImportStatement added in v0.0.21

func AddImportStatement(fileName, importName, alias string) error

AddImportStatement 添加import语句 例如: AddImportStatement("main.go", "fmt")

func Append added in v0.0.19

func Append(path string, content string) error

Append 往文件内追加内容

func FindStringsBetween added in v0.0.21

func FindStringsBetween(str, reg string) string

FindStringsBetween 从字符串中查找两个字符串之间的内容

func Has added in v0.0.20

func Has(path string, content string) (bool, error)

Has 判断文件内容是否包含某个字符串

func ReplaceInDir

func ReplaceInDir(dirPath, oldStr, newStr string) error

ReplaceInDir 替换目录下所有文件中的字符串

func Upload added in v0.5.0

func Upload(file multipart.File, fileHeader *multipart.FileHeader, filepath string, filename string) (string, string, error)

Upload 上传文件 @param file 文件 @param fileHeader 文件头 @param filepath 文件保存路径 @return 文件路径,文件名,错误

Types

This section is empty.

Jump to

Keyboard shortcuts

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