Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
package stderr
import "fmt"
// CustomErr 代替/common/error中的定义,逐渐在代码中弃掉(common/error模块)
type CustomErr struct {
Code Code `json:"code"`
Msg string `json:"msg"`
Tips string `json:"tips"`
}
// NewCustomErr an error
func NewCustomErr(code Code, Msg string, tips ...string) *CustomErr {
res := &CustomErr{
Code: code,
Msg: Msg,
Tips: Msg,
}
if len(tips) > 0 {
res.Tips = tips[0]
}
return res
}
// Error 返回字符串
func (s *CustomErr) Error() string {
if s == nil {
return ""
}
return fmt.Sprintf("code = %d, msg = %s ,tips = %v", s.Code, s.Msg, s.Tips)
}