mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-22 06:40:43 +08:00
19 lines
299 B
Go
19 lines
299 B
Go
package mysql
|
|
|
|
import (
|
|
"database/sql"
|
|
"fmt"
|
|
"testing"
|
|
|
|
_ "github.com/go-sql-driver/mysql"
|
|
)
|
|
|
|
func TestServer_NewConnection(t *testing.T) {
|
|
db, err := sql.Open("mysql", "root:root@tcp(127.0.0.1)/dbname?allowAllFiles=true")
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
|
|
_, _ = db.Exec("SELECT 1;")
|
|
}
|