fix variable shadowing (#5212)

Co-authored-by: Shenao Zhang <shenao.zhang@shopee.com>
This commit is contained in:
ZhangShenao 2022-03-31 20:57:20 +08:00 committed by GitHub
parent ea8509b777
commit 8333844f71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -124,8 +124,8 @@ func Open(dialector Dialector, opts ...Option) (db *DB, err error) {
for _, opt := range opts {
if opt != nil {
if err := opt.Apply(config); err != nil {
return nil, err
if applyErr := opt.Apply(config); applyErr != nil {
return nil, applyErr
}
defer func(opt Option) {
if errr := opt.AfterInitialize(db); errr != nil {