PersonalMain-Golang/utility/ErrorCode/ErrorCode.go
2023-12-25 02:19:00 +08:00

30 lines
417 B
Go

package ErrorCode
type ErrorCode struct {
output string
code int
message string
}
type Errors interface {
Output() string
Code() int
Message() string
}
var (
NoneDataResult = ErrorCode{output: "success", code: 200, message: "success"}
)
func (e ErrorCode) Output() string {
return e.output
}
func (e ErrorCode) Code() int {
return e.code
}
func (e ErrorCode) Message() string {
return e.message
}