---
title: "v2.10.4 2026-10-28"
url: "https://goframe.org/release/v2.10.4"
markdown_url: "https://goframe.org/release/v2.10.4.md"
locale: "zh-Hans"
version: "2.10.x(Latest)"
section: "版本发布记录"
category: "版本发布记录 / v2.10.x"
published: "2026-11-20"
updated: "2026-11-20"
description: "GoFrame v2.10.4 发布说明，包含 JSON 数组请求体与 HTTP 头常量等新功能，覆盖达梦、GaussDB、Oracle、MSSQL、PgSQL、SQLite、ClickHouse 等数据库驱动的大量修复，以及 ORM、HTTP 服务、配置、缓存、进程等模块的问题修复与性能优化。"
keywords: ["GoFrame", "v2.10.4", "版本发布", "JSON数组请求体", "HTTP头常量", "数据库驱动", "达梦", "GaussDB", "Oracle", "SQLite", "问题修复", "性能优化"]
---

# v2.10.4 2026-10-28

## GoFrame v2.10.4 发布：新增 JSON 数组请求体与 HTTP 头常量，全面修复达梦、GaussDB、Oracle、MSSQL 等数据库驱动并优化性能

`GoFrame v2.10.4` 已发布。本版本以问题修复为主，重点完善了各数据库驱动（达梦、`GaussDB`、`Oracle`、`MSSQL`、`PgSQL`、`SQLite`、`ClickHouse` 等）的兼容性与测试覆盖，同时新增 `JSON` 数组请求体支持、`HTTP` 头常量、本地编码 Agent 配置等能力，并带来多项性能优化。

完整变更：[https://github.com/gogf/gf/releases/tag/v2.10.4](https://github.com/gogf/gf/releases/tag/v2.10.4)

代码差异：[https://github.com/gogf/gf/compare/v2.10.3...v2.10.4](https://github.com/gogf/gf/compare/v2.10.3...v2.10.4)

---

## 新功能

### CLI / Agent

- 新增 `gf-pr-create` skill 并刷新根 `README`。[#4878](https://github.com/gogf/gf/pull/4878)（@gqcn）
- `agents`：并行执行 `gf-pr-review` 并尊重已有评论。[#4879](https://github.com/gogf/gf/pull/4879)（@gqcn）
- `agents`：扩展 PR review 并移除 `openspec` 工作流。[#4911](https://github.com/gogf/gf/pull/4911)（@gqcn）
- `cmd/gf`：新增 `gf agents` 命令用于本地编码 Agent 配置。[#4877](https://github.com/gogf/gf/pull/4877)（@gqcn）

### HTTP 服务 `net/ghttp` / OpenAPI `net/goai`

- 通过 `body:"*"` 字段标签支持 `JSON` 数组请求体（最初以 `in:"body"` 引入，随后在本版本改为 `body:"*"`）。[#4898](https://github.com/gogf/gf/pull/4898) [#4932](https://github.com/gogf/gf/pull/4932)（@LanceAdd）
- 新增导出的 `HTTP Header` 名称常量。[#4899](https://github.com/gogf/gf/pull/4899)（@LanceAdd）

---

## 问题修复

### 数据库驱动 `contrib/drivers`

- `clickhouse`：修正类型转换、插入与查询重写。[#4916](https://github.com/gogf/gf/pull/4916)（@lingcoder）
- `dm`（达梦）：保留带引号的标识符。[#4828](https://github.com/gogf/gf/pull/4828)（@yuyinw）；读取元数据列时忽略列名大小写。[#4875](https://github.com/gogf/gf/pull/4875)（@z312193608）；为 `DSN` 应用时区。[#4904](https://github.com/gogf/gf/pull/4904)（@014-code）；扩展测试覆盖至 `Oracle` 基线并完成 18 项驱动修复。[#4925](https://github.com/gogf/gf/pull/4925)（@lingcoder）
- `gaussdb`：`int1[]`、`int16[]` 数组正确回读为数组。[#4896](https://github.com/gogf/gf/pull/4896)（@lingcoder）
- `mssql`：扩展测试覆盖至 `MySQL` 基线并完成 16 项驱动修复。[#4924](https://github.com/gogf/gf/pull/4924)（@lingcoder）
- `oracle`：修正 `GBK` 解码与带引号标识符。[#4836](https://github.com/gogf/gf/pull/4836)（@yuyinw）；补齐至 `MySQL` 测试基线。[#4906](https://github.com/gogf/gf/pull/4906)（@lingcoder）
- `pgsql`：保留 `timetz` 的时区偏移。[#4903](https://github.com/gogf/gf/pull/4903)（@014-code）
- `sqlite`：根据主键推断保存冲突策略。[#4766](https://github.com/gogf/gf/pull/4766)（@gqcn）；`DAO` 发现时排除内部表。[#4908](https://github.com/gogf/gf/pull/4908)（@allenflux）

### 注册中心与配置中心 `contrib`

- `nacos`：升级 `nacos-sdk-go` 至 `70993e7`。[#4888](https://github.com/gogf/gf/pull/4888)（@lingcoder）
- `registry/nacos`：为注册中心配置新增 `Option` 模式。[#4938](https://github.com/gogf/gf/pull/4938)（@ShryukGrandhi）
- `registry/zookeeper`：注册服务时保留其他实例。[#4907](https://github.com/gogf/gf/pull/4907)（@taekop）

### ORM `database/gdb`

- 各驱动精确映射数据库类型名，不再按子串猜测。[#4882](https://github.com/gogf/gf/pull/4882)（@lingcoder）
- 未声明列中保留混合值。[#4905](https://github.com/gogf/gf/pull/4905)（@allenflux）
- 缓存被强制置空的结果。[#4919](https://github.com/gogf/gf/pull/4919)（@sean0407）
- 将空的 `TxOptions.Propagation` 视为默认值。[#4926](https://github.com/gogf/gf/pull/4926)（@somaz94）

### HTTP 服务 `net/ghttp` / 客户端 `net/gclient`

- `gclient`：移除链路追踪中已失效的请求体读取。[#4900](https://github.com/gogf/gf/pull/4900)（@LanceAdd）
- `ghttp`：避免请求结构解析时的 `nil` handler panic。[#4901](https://github.com/gogf/gf/pull/4901)（@LanceAdd）；避免未匹配路由解析时 `nil` serveHandler panic。[#4912](https://github.com/gogf/gf/pull/4912)（@LanceAdd）
- `ghttp`：比较路由优先级时剔除整个 `:name` 部分。[#4917](https://github.com/gogf/gf/pull/4917)（@LuisFigueroaG）
- `ghttp`：默认 `Swagger UI` 的 `Redoc` 固定为 `v2.5.3`。[#4922](https://github.com/gogf/gf/pull/4922)（@xuanwolei）
- `ghttp`：保护 `preBindItems` 免受并发启动影响。[#4927](https://github.com/gogf/gf/pull/4927)（@somaz94）
- `ghttp`：像 `PHP` 一样将重复 query key 的所有值绑定到切片字段。[#4928](https://github.com/gogf/gf/pull/4928)（@LuisFigueroaG）
- `ghttp`/`goai`/`gtag`：用 `body:"*"` 替代 `in:"body"` 表示整个请求体。[#4932](https://github.com/gogf/gf/pull/4932)（@LanceAdd）

### 其他模块

- `cmd/gf`：重新实现 `GoFmt`，避免逐文件调用 `go env` 子进程。[#4929](https://github.com/gogf/gf/pull/4929)（@hailaz）；确保已有路径时避免重复 import。[#4945](https://github.com/gogf/gf/pull/4945)（@LanceAdd）
- `os/gcfg`：加载失败后恢复文件监听器。[#4923](https://github.com/gogf/gf/pull/4923)（@014-code）
- `os/gfpool`：当池文件路径指向另一个文件时重新打开。[#4934](https://github.com/gogf/gf/pull/4934)（@ShryukGrandhi）
- `os/gproc`：关闭监听时恢复默认信号处理。[#4868](https://github.com/gogf/gf/pull/4868)（@jiang-bx）
- `os/gsession`：在 Unix 上发布原子文件快照。[#4910](https://github.com/gogf/gf/pull/4910)（@allenflux）
- `redis`：在 `Conn` 中固定专用连接以支持有状态命令。[#4864](https://github.com/gogf/gf/pull/4864)（@yangfei1024）
- `text/gstr`：修正 `StrTill` 返回的子串长度并补充单元测试。[#4873](https://github.com/gogf/gf/pull/4873)（@hailaz）
- `util/gconv`：转换带类型的 `time` 值时保留时区。[#4845](https://github.com/gogf/gf/pull/4845)（@hailaz）
- `util/grand`：保持闭区间持续时间。[#4915](https://github.com/gogf/gf/pull/4915)（@salapenar-max）
- `util/gvalid`：长度校验时按容器元素数量计算。[#4865](https://github.com/gogf/gf/pull/4865)（@jiang-bx）

---

## 性能优化

- `internal/instance`、`i18n/gi18n`、`os/gcfg`、`database/gdb`：使用读锁检查缓存实例。[#4902](https://github.com/gogf/gf/pull/4902)（@LanceAdd）
- `net/ghttp`：跳过未使用的请求标签处理。[#4889](https://github.com/gogf/gf/pull/4889)（@LanceAdd）
- `util/gvalid`：加速结构体校验。[#4886](https://github.com/gogf/gf/pull/4886)（@LanceAdd）

## 代码重构

- 多处模块统一使用常量。[#4931](https://github.com/gogf/gf/pull/4931)（@LanceAdd）
- `net/gclient`：将 `prepareRequest` 拆分为职责单一的辅助函数。[#4890](https://github.com/gogf/gf/pull/4890)（@LanceAdd）

## 测试

- 扩展多个驱动的测试覆盖至 `MySQL` 基线：`oceanbase`。[#4894](https://github.com/gogf/gf/pull/4894)、`sqlite`。[#4892](https://github.com/gogf/gf/pull/4892)（`+2` 驱动修复）、`sqlitecgo`。[#4897](https://github.com/gogf/gf/pull/4897)（`+3` 驱动修复）、`tidb`。[#4893](https://github.com/gogf/gf/pull/4893)（@lingcoder）
- `sqlite` 测试细节修正：Windows 下从盘符中正确取路径冒号。[#4885](https://github.com/gogf/gf/pull/4885)；通过 context 而非错误文本断言 `Test_DB_Ctx` 超时。[#4918](https://github.com/gogf/gf/pull/4918)（@lingcoder）

---

## 新贡献者

感谢以下同学首次向 `GoFrame` 提交代码（按首次贡献的 `PR` 排列）：

[@z312193608](https://github.com/z312193608)（[#4875](https://github.com/gogf/gf/pull/4875)）、[@yuyinw](https://github.com/yuyinw)（[#4828](https://github.com/gogf/gf/pull/4828)）、[@allenflux](https://github.com/allenflux)（[#4905](https://github.com/gogf/gf/pull/4905)）、[@014-code](https://github.com/014-code)（[#4904](https://github.com/gogf/gf/pull/4904)）、[@taekop](https://github.com/taekop)（[#4907](https://github.com/gogf/gf/pull/4907)）、[@yangfei1024](https://github.com/yangfei1024)（[#4864](https://github.com/gogf/gf/pull/4864)）、[@salapenar-max](https://github.com/salapenar-max)（[#4915](https://github.com/gogf/gf/pull/4915)）、[@xuanwolei](https://github.com/xuanwolei)（[#4922](https://github.com/gogf/gf/pull/4922)）、[@LuisFigueroaG](https://github.com/LuisFigueroaG)（[#4917](https://github.com/gogf/gf/pull/4917)）、[@somaz94](https://github.com/somaz94)（[#4927](https://github.com/gogf/gf/pull/4927)）、[@sean0407](https://github.com/sean0407)（[#4919](https://github.com/gogf/gf/pull/4919)）、[@ShryukGrandhi](https://github.com/ShryukGrandhi)（[#4938](https://github.com/gogf/gf/pull/4938)）。

也感谢本版本其他修复与功能的作者：@gqcn、@LanceAdd、@hailaz、@lingcoder、@jiang-bx。

---

## 升级建议

```bash
go get -u github.com/gogf/gf/v2@v2.10.4
```

`CLI` 请同步升到对应版本。若你用到以下能力，建议优先验证：

- `JSON` 数组请求体与 `body:"*"` 标签
- 达梦、`GaussDB`、`Oracle`、`MSSQL`、`PgSQL`、`SQLite`、`ClickHouse` 驱动
- `ORM` 类型映射与事务传播默认值
- HTTP 路由优先级、重复 query 参数绑定
- `os/gcfg` 文件监听、`os/gsession` 快照

问题与讨论：[https://github.com/gogf/gf/issues](https://github.com/gogf/gf/issues)

欢迎 `Star`、提 `Issue` 和 `PR`。`GoFrame`，让 Go 开发更简单。
