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()) }