utils

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger logger

Functions

func Clear

func Clear() error

清屏

func ErrorAssert

func ErrorAssert(err error, assert string) bool

错误断言

func Errorln

func Errorln(a ...interface{})

打印一行错误 字体颜色为红色

func FileIsExists

func FileIsExists(file string) (bool, error)

判断文件是否存在

func FormatSeparator

func FormatSeparator(title string, c string, maxlength int) string

左右填充 title 主体内容 c 填充符号 maxlength 总长度 如: title = 测试 c=* maxlength = 10 返回 ** 返回 **

func Info

func Info(a ...interface{})

打印信息(不换行) 字体颜色为绿色

func Infoln

func Infoln(a ...interface{})

打印一行信息 字体颜色为绿色

func Log

func Log(a ...interface{})

打印(不换行) 字体颜色为默色

func Logln

func Logln(a ...interface{})

打印一行信息 字体颜色为默色

func ParsePath

func ParsePath(path string) (string, error)

解析路径

func Scanln

func Scanln(a *string)

GO自带的fmt.Scanln将空格也当作结束符,若需要读取含有空格的句子请使用该方法

func SizeFormat

func SizeFormat(size float64) string

func ZhLen

func ZhLen(str string) int

计算字符宽度(中文)

Types

This section is empty.

Jump to

Keyboard shortcuts

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