From e901a1e964fc3c3ebe1e0446269a98616e9098e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Thu, 26 Nov 2026 20:45:00 -0800 Subject: [PATCH] =?UTF-8?q?docs(standards):=20=E6=98=8E=E7=A1=AE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=88=A4=E7=A9=BA=E4=B8=8E=E7=B1=BB=E5=9E=8B=E6=96=AD?= =?UTF-8?q?=E8=A8=80=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/standards/technical-specification.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/standards/technical-specification.md b/docs/standards/technical-specification.md index f22cfea..83af055 100644 --- a/docs/standards/technical-specification.md +++ b/docs/standards/technical-specification.md @@ -35,6 +35,7 @@ - 生产代码结构体字段带准确中文 dc 标签;导出字段显式声明 snake_case 的 json 标签,不参与序列化的运行依赖使用 json:"-"。匿名嵌入保留字段展开语义,测试夹具除外。 - 注释和提交描述使用中文;日志消息由调用处传入安全英文摘要,动态信息使用结构化字段。 - nil 的合法语义由契约声明;不重复防御已由构造函数保证的依赖,不以简化为由忽略错误或资源清理。 +- 接口入参允许 nil 且需要类型断言时,必须先判断接口是否为 nil 并处理,再执行类型断言。接口包含具体类型的 nil 指针时不等于 nil,类型断言仍可能成功;若契约允许该指针为 nil,必须在解引用前单独判断,不得用接口的 nil 检查替代具体指针的 nil 检查。 - 关键行为使用具名常量。兼容逻辑注明 target、introduced、owner、removal,不无条件删除仍有效兼容。 ## 4. 配置与安全