From 0e745fe5a168bbd9dfee882610c5bf69504261d7 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 16 Aug 2021 18:30:54 -0400 Subject: [PATCH] sql --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 9264ace..3227b67 100644 --- a/main.go +++ b/main.go @@ -149,7 +149,8 @@ func init() { dsn = flag.String("dsn", "", "Database connection string") sockpath = flag.String("sock", "", "Unix socket path") flag.Parse() - db, err := sql.Open("mysql", *dsn) + var err error + db, err = sql.Open("mysql", *dsn) if err != nil { log.Fatalf("sql.Open: %s", err.Error()) }