mirror of
https://github.com/netfun2000/rttys_zhaojh329.git
synced 2026-02-27 09:53:24 +08:00
chore: fix code style
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
+4
-4
@@ -2,23 +2,23 @@
|
||||
* @Author: 周家建
|
||||
* @Mail: zhou_0611@163.com
|
||||
* @Date: 2021-07-27 19:02:39
|
||||
* @Description:
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"database/sql"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func instanceDB(str string) (*sql.DB, error) {
|
||||
sp:= strings.Split(str, "://")
|
||||
sp := strings.Split(str, "://")
|
||||
if len(sp) == 2 {
|
||||
return sql.Open(sp[0], sp[1])
|
||||
} else {
|
||||
return sql.Open("mysql", str)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user