Documentation ¶
Index ¶
- func AppendToFile(filePath string, content string) error
- func BcryptCheck(password, hash string) bool
- func BcryptHash(password string) (pw string, err error)
- func CamelCase(input string) string
- func Capitalize(s string) string
- func Contains[T comparable](slice []T, element T) bool
- func CreateDirIfNotExist(path string) (err error)
- func Empty(val interface{}) bool
- func GetFileContent(filePath string) (content string, err error)
- func GetFirstRuneLower(s string) string
- func GetModule(pwd, format string) (result string)
- func InsertImport(filePath, newImport, format, t string) error
- func InsertStringInFile(filePath, contentToFind, stringToInsert string) error
- func MicrosecondsStr(elapsed time.Duration) string
- func PathExists(path string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendToFile ¶
AppendToFile appends the given content to the end of the specified file
func BcryptCheck ¶
BcryptCheck Compare the plaintext password with the database hash.
func BcryptHash ¶
BcryptHash Encrypt passwords using bcrypt.
func Contains ¶
func Contains[T comparable](slice []T, element T) bool
func CreateDirIfNotExist ¶
CreateDirIfNotExist Create dir if not existed.
func GetFileContent ¶
GetFileContent get file content return string.
func GetFirstRuneLower ¶
GetFirstRuneLower returns the first rune of a string in lowercase as a string
func InsertImport ¶
InsertImport 插入新的import路径到指定的Go文件中
func InsertStringInFile ¶ added in v1.1.0
InsertStringInFile inserts a string into a file after a specified content.
func MicrosecondsStr ¶
MicrosecondsStr Converts time to a string of milliseconds.
func PathExists ¶
PathExists checks if the specified path (file or directory) exists and returns a boolean value.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.