从本教程中rows.Closed()可以看出,必须调用 where rowsis from stmt.Query(),stmt.Closed()也应该调用 where stmtis from db.Prepare()?
// inside a function
stmt, err := db.Prepare(cmd) // cmd is SQL string
Check(err)
// should we add: defer stmt.Close()
rows, err := stmt.Query(params) // params is map/interface{}
defer rows.Close()
Check(err)
森栏
鸿蒙传说
相关分类