Call after initialize for gorm.Config (#7518)

This commit is contained in:
Jinzhu 2025-07-15 12:05:03 +08:00 committed by GitHub
parent 2f4925e017
commit 751a6dde7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -137,6 +137,14 @@ func Open(dialector Dialector, opts ...Option) (db *DB, err error) {
return isConfig && !isConfig2
})
if len(opts) > 0 {
if c, ok := opts[0].(*Config); ok {
config = c
} else {
opts = append([]Option{config}, opts...)
}
}
var skipAfterInitialize bool
for _, opt := range opts {
if opt != nil {