util

package
v0.0.0-...-a11b62f Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error, exitCode int)

CheckErr 检查是否有错误,并退出操作系统

func CheckFatal

func CheckFatal(err error)

CheckFatal 检查致命错误

func Extract

func Extract(pattern, s string) string

Extract 提取匹配的字符串

func FullMatch

func FullMatch(pattern string, s string) bool

FullMatch 全匹配字符串

func InitLog

func InitLog()

InitLog 初始化 log

func Match

func Match(pattern string, s string) (matched bool)

Match 匹配字符串

func Printf

func Printf(format string, data Dater)

Printf 格式打印

func Println

func Println(data Dater)

Println 打印一行数据

func Recover

func Recover()

Recover 检查错误,并打印

func Reverse

func Reverse(s []byte) []byte

Reverse 对 byte Slice 进行反转

func Sprintf

func Sprintf(format string, args ...interface{}) (d string)

Sprintf 字符串格式化,解决汉字宽度及数字无千分节问题

func Wlen

func Wlen(s string) (length int)

Wlen 统计字符串的打印宽度, ASCII 为 1,汉字为 2

Types

type Dater

type Dater interface {
	Next() bool
	Read() []interface{}
}

Dater 数据接口

Jump to

Keyboard shortcuts

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