sql.Register("sqlWithHooks", sqlhooks.Wrap(r.Driver(), &Hooks{}))
// Connect to the registered wrapped driver
db, err := sql.Open("sqlWithHooks", ":memory:")
if err != nil {
fmt.Println("error",err)
}
rows, err := db.Query("SELECT id,name,cid,dimension,price FROM table_name ")
if err != nil {
fmt.Println("inside the error .........................",err)
}
运行此代码后,我收到连接信息字符串中“:内存:”之后缺少“=”的错误。谁能告诉我我在这里所做的有什么问题?
梵蒂冈之花
呼啦一阵风
相关分类