Commit 60ba4c36 authored by gwenn's avatar gwenn

Update main example.

parent 245e67ab
...@@ -29,17 +29,14 @@ func Example() { ...@@ -29,17 +29,14 @@ func Example() {
defer ins.Finalize() defer ins.Finalize()
_, err = ins.Insert("gosqlite driver") _, err = ins.Insert("gosqlite driver")
check(err) check(err)
s, err := db.Prepare("SELECT name FROM test WHERE name LIKE ?", "%go%")
check(err)
defer s.Finalize()
var name string var name string
err = s.Select(func(s *sqlite.Stmt) (err error) { err = db.Select("SELECT name FROM test WHERE name LIKE ?", func(s *sqlite.Stmt) (err error) {
if err = s.Scan(&name); err != nil { if err = s.Scan(&name); err != nil {
return return
} }
fmt.Println(name) fmt.Println(name)
return return
}) }, "%go%")
check(err) check(err)
// Output: gosqlite driver // Output: gosqlite driver
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment