mirror of
https://github.com/tiennm99/keepalive.git
synced 2026-08-06 14:24:35 +00:00
feat: remove driver name config
This commit is contained in:
@@ -1,2 +1 @@
|
||||
DRIVER_NAME=mysql
|
||||
DATA_SOURCE_NAME=keepalive:keepalive@tcp(localhost:3306)/keepalive?tls=custom
|
||||
|
||||
+1
-7
@@ -20,12 +20,6 @@ func main() {
|
||||
log.Println("Warning: .env file not found")
|
||||
}
|
||||
|
||||
driverName, isExist := os.LookupEnv("DRIVER_NAME")
|
||||
if !isExist {
|
||||
log.Fatal("Warning: DRIVER_NAME not set!")
|
||||
return
|
||||
}
|
||||
|
||||
dataSourceName, isExist := os.LookupEnv("DATA_SOURCE_NAME")
|
||||
if !isExist {
|
||||
log.Fatal("Warning: DATA_SOURCE_NAME not set!")
|
||||
@@ -46,7 +40,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
db, err := sql.Open(driverName, dataSourceName)
|
||||
db, err := sql.Open("mysql", dataSourceName)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user