init: 通用库抽离——httpx/logger/wsc/wscclient/jwtx(合并分叉副本); 顶层包布局; module path git.zeroonesoft.cn/golib/zogo

This commit is contained in:
w11
2026-09-19 19:04:01 +08:00
commit f0f5421262
17 changed files with 2336 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
package httpx
import "fmt"
// CodeMsg 包含 code 与 msg 的错误结构,实现了 error 接口。
type CodeMsg struct {
Code int
Msg string
}
func (c *CodeMsg) Error() string {
return fmt.Sprintf("code: %d, msg: %s", c.Code, c.Msg)
}
// New 创建一个 CodeMsg 错误。
func New(code int, msg string) error {
return &CodeMsg{Code: code, Msg: msg}
}