diff --git a/all_test.go b/all_test.go index 732e8f6..2d8df4d 100644 --- a/all_test.go +++ b/all_test.go @@ -1546,11 +1546,18 @@ func TestIssue53(t *testing.T) { t.Fatal(err) } - db, err := sql.Open(driverName, "testissue53.sqlite") + const fn = "testissue53.sqlite" + + db, err := sql.Open(driverName, fn) if err != nil { t.Fatal(err) } + defer func() { + db.Close() + os.Remove(fn) + }() + if _, err := db.Exec(` CREATE TABLE IF NOT EXISTS loginst ( instid INTEGER PRIMARY KEY, @@ -1593,9 +1600,9 @@ func TestPersistPragma(t *testing.T) { } pragmas := []pragmaCfg{ - {"foreign_keys", "on", int64(1)}, - {"analysis_limit", "1000", int64(1000)}, - {"application_id", "214", int64(214)}, + {"foreign_keys", "on", int64(1)}, + {"analysis_limit", "1000", int64(1000)}, + {"application_id", "214", int64(214)}, {"encoding", "'UTF-16le'", "UTF-16le"}} if err := testPragmas("testpersistpragma.sqlite", "testpersistpragma.sqlite", pragmas); err != nil { diff --git a/cgo_test.go b/cgo_test.go index ae80753..2a76c50 100644 --- a/cgo_test.go +++ b/cgo_test.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//+build cgo,cgobench +//go:build cgo && cgobench +// +build cgo,cgobench package sqlite // import "modernc.org/sqlite" diff --git a/generator.go b/generator.go index 745ae33..1c5e2a5 100644 --- a/generator.go +++ b/generator.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build generator // +build generator package main diff --git a/sqlite.go b/sqlite.go index 519a5d9..ec3873e 100644 --- a/sqlite.go +++ b/sqlite.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. - //go:generate go run generator.go //go:generate go fmt ./... diff --git a/sqlite_go18.go b/sqlite_go18.go index 74b3e9d..474d002 100644 --- a/sqlite_go18.go +++ b/sqlite_go18.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.8 // +build go1.8 package sqlite // import "modernc.org/sqlite" diff --git a/sqlite_go18_test.go b/sqlite_go18_test.go index 027240f..05630f0 100644 --- a/sqlite_go18_test.go +++ b/sqlite_go18_test.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.8 // +build go1.8 package sqlite // import "modernc.org/sqlite"