utility

package
v0.0.0-...-f278672 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareHashAndPassword

func CompareHashAndPassword(e string, p string) (bool, error)

func Contains

func Contains(s []string, i string) bool

Contains 字符串切片s是否包含字符串i

func GenerateMsgIDFromContext

func GenerateMsgIDFromContext(c *gin.Context) string

GenerateMsgIDFromContext 生成msgID

func HasError

func HasError(err error, msg string, code ...int)

HasError 错误断言 当 error 不为 nil 时触发 panic 对于当前请求不会再执行接下来的代码,并且返回指定格式的错误信息和错误码 若 msg 为空,则默认为 error 中的内容

Types

This section is empty.

Jump to

Keyboard shortcuts

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