Files
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

28 lines
479 B
Go

package db
// 事务设置
type TransOpts struct {
ReEntryCount *int //重入次数
//...
}
func (t *TransOpts) SetReEntry(count int) *TransOpts {
t.ReEntryCount = &count
return t
}
// MergeTransOpts 合并事务设置
func MergeTransOpts(opts []*TransOpts) *TransOpts {
transOpts := &TransOpts{}
for _, opt := range opts {
if opt == nil {
continue
}
if opt.ReEntryCount != nil {
transOpts.ReEntryCount = opt.ReEntryCount
//...
}
}
return transOpts
}