package core import "fmt" type WxError struct { ErrorCode int // 错误码 Message string // 错误信息 } func (e WxError) Error() string { return fmt.Sprintf("Error Code: %d, Message: %s", e.ErrorCode, e.Message) } // Code Error 错误码 func (e WxError) Code() int { return e.ErrorCode } // ErrorMsg Error 错误信息 func (e WxError) ErrorMsg() int { return e.ErrorMsg() }