From c6d15ac7a014ef82e5d427d33f76e7049b47c402 Mon Sep 17 00:00:00 2001 From: k1LoW Date: Thu, 16 May 2024 15:59:00 +0900 Subject: [PATCH] Fix --- datasource/datasource.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datasource/datasource.go b/datasource/datasource.go index c5c315038..0b161f612 100644 --- a/datasource/datasource.go +++ b/datasource/datasource.go @@ -86,12 +86,12 @@ func Analyze(dsn config.DSN) (*schema.Schema, error) { } db, err := dburl.Open(urlstr) - defer func() { - _ = db.Close() - }() if err != nil { return s, errors.WithStack(err) } + defer func() { + _ = db.Close() + }() if err := db.Ping(); err != nil { return s, errors.WithStack(err) }