diff options
| author | mattn <mattn.jp@gmail.com> | 2013-09-09 10:44:44 +0900 |
|---|---|---|
| committer | mattn <mattn.jp@gmail.com> | 2013-09-09 10:44:44 +0900 |
| commit | d4673cd31cac7742ce1735defa74d63090ac3401 (patch) | |
| tree | 3da80a8ee6040c2ca063888718662834ad33e1fe /_example | |
| parent | Remove old information (diff) | |
| download | golite-d4673cd31cac7742ce1735defa74d63090ac3401.tar.gz golite-d4673cd31cac7742ce1735defa74d63090ac3401.tar.xz | |
Implements Execer
Diffstat (limited to '_example')
| -rw-r--r-- | _example/simple/simple.go | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/_example/simple/simple.go b/_example/simple/simple.go index 5e9c902..21c09c9 100644 --- a/_example/simple/simple.go +++ b/_example/simple/simple.go @@ -17,16 +17,14 @@ func main() { } defer db.Close() - sqls := []string{ - "create table foo (id integer not null primary key, name text)", - "delete from foo", - } - for _, sql := range sqls { - _, err = db.Exec(sql) - if err != nil { - log.Printf("%q: %s\n", err, sql) - return - } + sql := ` + create table foo (id integer not null primary key, name text); + delete from foo; + ` + _, err = db.Exec(sql) + if err != nil { + log.Printf("%q: %s\n", err, sql) + return } tx, err := db.Begin() |
