修复 UR#55 代码审查问题:事务隔离、错误包装、重复辅助函数
- resolvePackageTerms 接受 tx 参数并使用事务绑定的 Store,确保快照与写入同库 - auto_purchase.go 错误包装改用 pkgerrors.Wrap 而非标准库 errors - shop_package_batch_allocation 去除 fmt 依赖改用 strconv 拼接 - shop_series_grant 提取 effectiveBase 局部变量避免重复调用 - 测试辅助函数统一迁移至 testutil.StringPointer,删除各文件本地重复定义 - 新增 testutil.NewRedisClient 和 testutil.StringPointer Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -61,3 +61,6 @@ func NewRedisClient(t *testing.T) *redis.Client {
|
||||
t.Cleanup(func() { _ = client.Close() })
|
||||
return client
|
||||
}
|
||||
|
||||
// StringPointer 返回字符串值的指针,供测试用例构造 nullable string 参数。
|
||||
func StringPointer(s string) *string { return &s }
|
||||
|
||||
Reference in New Issue
Block a user