ecode

package
v0.0.0-...-26e1b9e Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

README

Ecode模块

Ecode模块提供了常见的错误码、初始化错误码以及解释错误码的功能。

使用示例:

ecode:=New("GF021103","测试错误码")
fmt.Println(ecode.Error())

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OK = New("200", "")
)

Functions

This section is empty.

Types

type Codes

type Codes struct {
	Code string `json:"code,omitempty"`
	Msg  string `json:"msg,omitempty"`
}

func Cause

func Cause(err error) Codes

func New

func New(code, msg string) Codes

func String

func String(e string) Codes

func (Codes) Error

func (e Codes) Error() string

Jump to

Keyboard shortcuts

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