抽取 Gin、配置、日志、数据库、Redis 与出站 HTTP 基础能力。 新增统一接入指南,将能力清单和相对链接检查纳入 make verify。 对齐远端 module 路径,修正 Redis 读写超时特殊值映射。 验证:make verify、make race-check 均通过。
This commit is contained in:
commit
b4c3ac622c
55 files changed
+5862
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package fault
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestInternalCausePreservesClassification(t *testing.T) {
|
||||
cause := errors.Join(context.Canceled, errors.New("private-database-password"))
|
||||
err := New(900001, "open connection failed", cause)
|
||||
if !errors.Is(err, context.Canceled) || !Internal(err) || err.Code() != 900001 {
|
||||
t.Fatal("cause or classification lost")
|
||||
}
|
||||
if err.Error() != "open connection failed" {
|
||||
t.Fatal("private text leaked")
|
||||
}
|
||||
}
|
||||