package exception import ( "fmt" ) type BaseError struct { Code int Msg string ShortMsg string } func (err BaseError) Error() string { return fmt.Sprintf("%d - 错误: %s - 原因:%s", err.Code, err.ShortMsg, err.Msg) }