dual check v0.1

This commit is contained in:
cancerai committed 2026-08-29 23:34:01 +08:00
1 parent 78bad1fa3d
commit c137299016
36 files changed
+3727 -81

No files matched your search

@@ -0,0 +1,15 @@
package dual_check
// BusinessError 业务错误
type BusinessError struct {
Code int
Message string
}
// Error 返回错误描述:优先用自定义 Message,否则回退到 ErrMessage(code)
func (e *BusinessError) Error() string {
if e.Message != "" {
return e.Message
}
return ErrMessage(e.Code)
}