xerror

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

Error ...

func Errors

func Errors() []*Error

Errors 返回所有 error 列表 按 code 升序 通过 WithMsg 声明的错误码不重复显示

func New

func New(code int, msg string) *Error

New ...

func (*Error) Error

func (e *Error) Error() string

Error ...

func (*Error) WithMsg

func (e *Error) WithMsg(msg string) *Error

WithMsg 自定义错误文案

Jump to

Keyboard shortcuts

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