utils

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendFileCode added in v0.1.2

func AppendFileCode(filePath, searchCode, addCode, find string) (string, error)

func AppendStrCode added in v0.1.2

func AppendStrCode(str, searchCode, addCode, find string) (string, error)

func CreteFile

func CreteFile(dir string, fileName string) (fp *os.File, created bool, err error)

func FormatCode

func FormatCode(code string) string

func GenFile

func GenFile(c FileGenConfig) error

func GenFileCover

func GenFileCover(c FileGenConfig) error

func GetDir

func GetDir(method string, name string) string

func GetPackage

func GetPackage(wd string) (string, error)

func MaybeCreteFile

func MaybeCreteFile(dir string, fileName string) (fp *os.File, created bool, err error)

func Md5ByString

func Md5ByString(str string) string

func MustConfig

func MustConfig(path string, config interface{})

func ToLowers

func ToLowers(str ...*string)

func ToUppers added in v0.1.3

func ToUppers(str ...*string)

func UpperOne

func UpperOne(str string) string

func WriteInfile

func WriteInfile(filePath, code string) error

Types

type FileGenConfig

type FileGenConfig struct {
	Dir          string
	Filename     string
	TemplateFile string
	Data         interface{}
}

Jump to

Keyboard shortcuts

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