Repository navigation
What's Changed
feat
- feat(contrib/rpc/grpcx): add server side timeout for unary requests by @officialasishkumar in #4996
- feat(net/ghttp): add
AutoDecodingBodyDisabledconfiguration forghttp.Serverby @gqcn in #4197
fix
- fix: update gf cli to v2.10.5 by @github-actions[bot] in #5002
- fix(cmd/gf): restore imports.Process based GoFmt after upstream fix by @hailaz in #5045
- fix(container/garray): support the documented negative end in Range by @ruziba3vich in #5020
- fix(contrib/rpc/grpcx): protect listener with a mutex to fix data race by @hailaz in #5046
- fix(contrib/rpc/grpcx): do not exit on grpc.ErrServerStopped from Serve by @LanceAdd in #5049
- fix(database/gdb): emit the PARTITION clause of Model.Partition() in SELECT queries by @lingcoder in #4976
- fix(encoding/gbinary): keep EncodeBitsToBytes from mutating the caller slice by @LanceAdd in #5011
- fix(encoding/gcompress): prevent zip path traversal on extraction by @LanceAdd in #5010
- fix(encoding/gcompress): close decompression readers by @LanceAdd in #5013
- fix(encoding/gini): parse the last line without a trailing newline by @LanceAdd in #5014
- fix(encoding/gjson): reject negative array indexes without partial writes by @LanceAdd in #5012
- fix(encoding/gurl): keep literal plus signs in RawDecode by @LanceAdd in #5016
- fix(genctrl): detect parameterized NewV1 constructor to avoid duplicate ControllerV1 by @Lizjunn in #4980
- fix(net/gclient): keep query parameters before url fragment by @LanceAdd in #5025
- fix(net/ghttp): anchor static file reads to the search root by @LanceAdd in #4985
- fix(net/ghttp): parse host and port with net.SplitHostPort by @LanceAdd in #5007
- fix(net/ghttp): escape static directory listing links by @LanceAdd in #5009
- fix(net/gipv4): fix panic of Ip2long on an IPv6 address by @ruziba3vich in #4990
- fix(net/gipv4): detect intranet addresses with netip by @LanceAdd in #5006
- fix(net/gtrace): detect gzip content encoding case-insensitively by @LanceAdd in #5026
- fix(os/gcron): reject a pattern interval below 1 instead of looping forever by @ruziba3vich in #5019
- fix(os/gfile): stop dropping over-long lines in ReadLines by @LanceAdd in #5024
- fix(os/gspath): keep search results inside the searching root by @LanceAdd in #5023
- fix(os/gtime): fix Timestamp overflow outside the UnixNano range by @ruziba3vich in #4989
- fix(os/gtime): fix zone offset lost by StrToTime across DST by @ruziba3vich in #4995
- fix(os/gtime,os/gcron,internal/tracing): use the Unix time helpers by @LanceAdd in #5005
- fix(text/gstr): fix endless loop of TrimLeftStr/TrimRightStr on empty cut by @ruziba3vich in #4991
- fix(text/gstr): fix result of Str for a needle longer than one byte by @ruziba3vich in #4992
- fix(text/gstr): fix StrLimit suffix on a string of exactly the length by @ruziba3vich in #4993
- fix(util/gutil): fix wrong sign of integer comparators on overflow by @ruziba3vich in #4994
- fix(util/gutil): compare typed values instead of subtracting them by @LanceAdd in #5004
refactor
- refactor(container,database,encoding,net,os,cmd/gf): use slices for sorting by @LanceAdd in #4997
- refactor(container/garray,text/gstr,os/gcmd): use slices helpers by @LanceAdd in #5000
- refactor(container/gset,container/gmap,util/gutil): use maps and slices helpers by @LanceAdd in #4999
- refactor(encoding): use stdlib equivalents for small helpers by @LanceAdd in #5015
- refactor(encoding,net,os,text/gstr,util/gvalid,internal/httputil): use strings.Cut and standard helpers by @LanceAdd in #4998
- refactor(encoding/gjson): drop dead nested-array extension loop by @LanceAdd in #5017
test
- test(contrib/config): add adapter_ctx unit tests for nacos and consul by @lingcoder in #5033
- test(contrib/nosql/redis): add StorageRedis and StorageRedisHashTable unit tests by @lingcoder in #5034
- test(contrib/rpc/grpcx): add tracing Inject/Extract unit tests by @lingcoder in #5035
- test(database/gdb): fix Cache Force in 10 drivers and add DryRun/Hook unit tests by @lingcoder in #5031
- test(net/gsel): add unit tests for all four selector algorithms and builders by @lingcoder in #5030
- test(net/gsvc): add unit tests for Endpoint, Endpoints, Metadata, and LocalService by @lingcoder in #5032
docs
- docs: add feature map and CLI reference to README by @hailaz in #5018
- docs: add issue review skill and bilingual pr comments by @gqcn in #5036
- docs(cmd/gf,os/gbuild): fix 'build-in' to 'built-in' in help text and docs by @kayaal34 in #5027
- docs(text/gstr): fix wrong examples in doc comments by @Kernel-Hunter in #4978
ci
- ci(codecov): tolerate a 0.1% project coverage drop by @lingcoder in #5053
chore
- chore(container/gmap): drop the stale go1.24 build tag by @LanceAdd in #5003
- chore(release): bump version to v2.10.6 by @hailaz in #5055
New Contributors
- @ruziba3vich made their first contribution in #4993
- @kayaal34 made their first contribution in #5027
- @Lizjunn made their first contribution in #4980
- @officialasishkumar made their first contribution in #4996
Full Changelog: v2.10.5...v2.10.6
更新说明
新功能 feat
- feat(contrib/rpc/grpcx):为一元请求新增服务端超时 by @officialasishkumar in #4996
- feat(net/ghttp):为
ghttp.Server新增AutoDecodingBodyDisabled配置项 by @gqcn in #4197
问题修复 fix
- fix:更新
gfCLI 依赖到 v2.10.5 by @github-actions[bot] in #5002 - fix(cmd/gf):在上游修复后恢复基于
imports.Process的GoFmtby @hailaz in #5045 - fix(container/garray):
Range支持文档约定的负数结束下标 by @ruziba3vich in #5020 - fix(contrib/rpc/grpcx):为监听器加互斥锁修复数据竞争 by @hailaz in #5046
- fix(contrib/rpc/grpcx):
Serve返回grpc.ErrServerStopped时不再退出进程 by @LanceAdd in #5049 - fix(database/gdb):
SELECT查询输出Model.Partition()设置的PARTITION子句 by @lingcoder in #4976 - fix(encoding/gbinary):
EncodeBitsToBytes不再修改调用方传入的切片 by @LanceAdd in #5011 - fix(encoding/gcompress):阻止
zip解压路径穿越 by @LanceAdd in #5010 - fix(encoding/gcompress):关闭解压读取器 by @LanceAdd in #5013
- fix(encoding/gini):解析没有结尾换行的最后一行 by @LanceAdd in #5014
- fix(encoding/gjson):拒绝负数组下标且不产生部分写入 by @LanceAdd in #5012
- fix(encoding/gurl):
RawDecode保留字面加号 by @LanceAdd in #5016 - fix(genctrl):识别带参数的
NewV1构造器,避免重复生成ControllerV1by @Lizjunn in #4980 - fix(net/gclient):保留
URL片段之前的查询参数 by @LanceAdd in #5025 - fix(net/ghttp):静态文件读取锚定到搜索根目录 by @LanceAdd in #4985
- fix(net/ghttp):使用
net.SplitHostPort解析host与端口 by @LanceAdd in #5007 - fix(net/ghttp):转义静态目录列表中的链接 by @LanceAdd in #5009
- fix(net/gipv4):修复
Ip2long处理IPv6地址时的panicby @ruziba3vich in #4990 - fix(net/gipv4):使用
netip判断内网地址 by @LanceAdd in #5006 - fix(net/gtrace):大小写不敏感地识别
gzip内容编码 by @LanceAdd in #5026 - fix(os/gcron):间隔小于
1的表达式直接报错,不再无限循环 by @ruziba3vich in #5019 - fix(os/gfile):
ReadLines不再丢弃超长行 by @LanceAdd in #5024 - fix(os/gspath):搜索结果保持在搜索根目录内 by @LanceAdd in #5023
- fix(os/gtime):修复
Timestamp在UnixNano范围外溢出 by @ruziba3vich in #4989 - fix(os/gtime):修复
StrToTime跨夏令时丢失时区偏移 by @ruziba3vich in #4995 - fix(os/gtime,os/gcron,internal/tracing):改用 Unix 时间辅助函数 by @LanceAdd in #5005
- fix(text/gstr):修复
TrimLeftStr、TrimRightStr在空切分串时的死循环 by @ruziba3vich in #4991 - fix(text/gstr):修正
Str在查找串长度大于一个字节时的返回结果 by @ruziba3vich in #4992 - fix(text/gstr):修复字符串长度恰好等于限制值时的
StrLimit后缀 by @ruziba3vich in #4993 - fix(util/gutil):修复整数比较器溢出时返回错误符号 by @ruziba3vich in #4994
- fix(util/gutil):比较类型化取值而非相减 by @LanceAdd in #5004
代码重构 refactor
- refactor(container,database,encoding,net,os,cmd/gf):排序逻辑改用
slicesby @LanceAdd in #4997 - refactor(container/garray,text/gstr,os/gcmd):改用
slices辅助函数 by @LanceAdd in #5000 - refactor(container/gset,container/gmap,util/gutil):改用
maps与slices辅助函数 by @LanceAdd in #4999 - refactor(encoding):小型辅助函数改用标准库等价实现 by @LanceAdd in #5015
- refactor(encoding,net,os,text/gstr,util/gvalid,internal/httputil):改用
strings.Cut等标准辅助函数 by @LanceAdd in #4998 - refactor(encoding/gjson):移除失效的嵌套数组扩展循环 by @LanceAdd in #5017
测试 test
- test(contrib/config):补充
nacos与consul适配器上下文单元测试 by @lingcoder in #5033 - test(contrib/nosql/redis):补充
StorageRedis与StorageRedisHashTable单元测试 by @lingcoder in #5034 - test(contrib/rpc/grpcx):补充链路注入与提取的单元测试 by @lingcoder in #5035
- test(database/gdb):修复 10 个驱动的
Cache、Force并补充DryRun、Hook单元测试 by @lingcoder in #5031 - test(net/gsel):为四种选择算法与构建器补充单元测试 by @lingcoder in #5030
- test(net/gsvc):补充
Endpoint、Endpoints、Metadata与LocalService单元测试 by @lingcoder in #5032
文档 docs
- docs:
README新增功能地图与CLI参考 by @hailaz in #5018 - docs:新增 Issue 审查技能与中英双语
PR评论说明 by @gqcn in #5036 - docs(cmd/gf,os/gbuild):将帮助文本与文档中的
build-in修正为built-inby @kayaal34 in #5027 - docs(text/gstr):修正文档注释中的错误示例 by @Kernel-Hunter in #4978
CI
- ci(codecov):容忍
0.1%的项目覆盖率下降 by @lingcoder in #5053
其他 chore
- chore(container/gmap):移除过时的
go1.24构建标签 by @LanceAdd in #5003 - chore(release):版本号提升到 v2.10.6 by @hailaz in #5055
新贡献者
- @ruziba3vich 在 #4993 中完成了首次贡献
- @kayaal34 在 #5027 中完成了首次贡献
- @Lizjunn 在 #4980 中完成了首次贡献
- @officialasishkumar 在 #4996 中完成了首次贡献
完整变更:v2.10.5...v2.10.6