// Code is universal error code interface definition.
type Code interface {
// Code returns the integer number of current error code.
Code() int
// Message returns the brief message for current error code.
Message() string
// Detail returns the detailed information of current error code,
// which is mainly designed as an extension field for error code.
Detail() interface{}
}
// New creates and returns an error code.
// Note that it returns an interface object of Code.
func New(code int, message string, detail interface{}) Code