package starainrt import ( "fmt" "testing" _ "github.com/mattn/go-sqlite3" ) func TestDataBase(t *testing.T) { mysql := new(StarDB) defer mysql.Close() mysql.Open("sqlite3", "D:\\Ttest.db") mysql.Exec("CREATE TABLE IF NOT EXISTS sakura(id INT PRIMARY KEY,xihuan TEXT)") mysql.Exec("INSERT INTO sakura VALUES(?,?)", 2, "dssfsdfdf") sakura, _ := mysql.Query("SELECT * FROM sakura") defer sakura.Close() fmt.Println(sakura.Row(0).MustString("xihuan")) }