Skip to content

Commit

Permalink
chore: fix code style
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <[email protected]>
  • Loading branch information
zhaojh329 committed Apr 12, 2022
1 parent 4a55679 commit 03b976a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions database.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
* @Author: 周家建
* @Mail: [email protected]
* @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)
}
}
}

0 comments on commit 03b976a

Please sign in to comment.