package models type Error struct { Code int Message string } func New(code int, msg string) *Error { return &Error{ Code: code, Message: msg, } } func (e *Error) ErrCode() int { return e.Code } func (e *Error) ErrMessage() string { return e.Message }