feat: remove driver name config

This commit is contained in:
2025-11-27 22:39:57 +07:00
parent 40e433e284
commit e09ddceb37
2 changed files with 1 additions and 8 deletions
-1
View File
@@ -1,2 +1 @@
DRIVER_NAME=mysql
DATA_SOURCE_NAME=keepalive:keepalive@tcp(localhost:3306)/keepalive?tls=custom
+1 -7
View File
@@ -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)
}