Repository: mattn/go-sqlite3
Pull request #1208 (2024-01-25 13:37:03)

update go version to 1.19


Patch:
diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml
index 923274b..c96bf31 100644
--- a/.github/workflows/go.yaml
+++ b/.github/workflows/go.yaml
@@ -14,7 +14,7 @@ jobs:
     strategy:
       matrix:
         os: [ubuntu-latest, macos-latest]
-        go: ['1.18', '1.19', '1.20']
+        go: ['1.19', '1.20', '1.21']
       fail-fast: false
     env:
       OS: ${{ matrix.os }}
@@ -64,7 +64,7 @@ jobs:
 
     strategy:
       matrix:
-        go: ['1.18', '1.19', '1.20']
+        go: ['1.19', '1.20', '1.21']
       fail-fast: false
     env:
       OS: windows-latest
diff --git a/_example/limit/limit.go b/_example/limit/limit.go
index bcba819..c1adfe8 100644
--- a/_example/limit/limit.go
+++ b/_example/limit/limit.go
@@ -10,9 +10,9 @@ import (
 	"github.com/mattn/go-sqlite3"
 )
 
-func createBulkInsertQuery(n int, start int) (query string, args []interface{}) {
+func createBulkInsertQuery(n int, start int) (query string, args []any) {
 	values := make([]string, n)
-	args = make([]interface{}, n*2)
+	args = make([]any, n*2)
 	pos := 0
 	for i := 0; i < n; i++ {
 		values[i] = "(?, ?)"
@@ -27,7 +27,7 @@ func createBulkInsertQuery(n int, start int) (query string, args []interface{})
 	return
 }
 
-func bulkInsert(db *sql.DB, query string, args []interface{}) (err error) {
+func bulkInsert(db *sql.DB, query string, args []any) (err error) {
 	stmt, err := db.Prepare(query)
 	if err != nil {
 		return
diff --git a/_example/vtable/vtable.go b/_example/vtable/vtable.go
index 10d12a9..c65535b 100644
--- a/_example/vtable/vtable.go
+++ b/_example/vtable/vtable.go
@@ -93,7 +93,7 @@ func (vc *ghRepoCursor) Column(c *sqlite3.SQLiteContext, col int) error {
 	return nil
 }
 
-func (vc *ghRepoCursor) Filter(idxNum int, idxStr string, vals []interface{}) error {
+func (vc *ghRepoCursor) Filter(idxNum int, idxStr string, vals []any) error {
 	vc.index = 0
 	return nil
 }
diff --git a/_example/vtable_eponymous_only/vtable.go b/_example/vtable_eponymous_only/vtable.go
index 49fc0b7..9f22ebc 100644
--- a/_example/vtable_eponymous_only/vtable.go
+++ b/_example/vtable_eponymous_only/vtable.go
@@ -77,7 +77,7 @@ func (vc *seriesCursor) Column(c *sqlite3.SQLiteContext, col int) error {
 	return nil
 }
 
-func (vc *seriesCursor) Filter(idxNum int, idxStr string, vals []interface{}) error {
+func (vc *seriesCursor) Filter(idxNum int, idxStr string, vals []any) error {
 	switch {
 	case len(vals) < 1:
 		vc.seriesTable.start = 0
diff --git a/callback.go b/callback.go
index d305691..b794bcd 100644
--- a/callback.go
+++ b/callback.go
@@ -100,13 +100,13 @@ func preUpdateHookTrampoline(handle unsafe.Pointer, dbHandle uintptr, op int, db
 // Use handles to avoid passing Go pointers to C.
 type handleVal struct {
 	db  *SQLiteConn
-	val interface{}
+	val any
 }
 
 var handleLock sync.Mutex
 var handleVals = make(map[unsafe.Pointer]handleVal)
 
-func newHandle(db *SQLiteConn, v interface{}) unsafe.Pointer {
+func newHandle(db *SQLiteConn, v any) unsafe.Pointer {
 	handleLock.Lock()
 	defer handleLock.Unlock()
 	val := handleVal{db: db, val: v}
@@ -124,7 +124,7 @@ func lookupHandleVal(handle unsafe.Pointer) handleVal {
 	return handleVals[handle]
 }
 
-func lookupHandle(handle unsafe.Pointer) interface{} {
+func lookupHandle(handle unsafe.Pointer) any {
 	return lookupHandleVal(handle).val
 }
 
@@ -238,7 +238,7 @@ func callbackArg(typ reflect.Type) (callbackArgConverter, error) {
 	switch typ.Kind() {
 	case reflect.Interface:
 		if typ.NumMethod() != 0 {
-			return nil, errors.New("the only supported interface type is interface{}")
+			return nil, errors.New("the only supported interface type is any")
 		}
 		return callbackArgGeneric, nil
 	case reflect.Slice:
@@ -360,11 +360,11 @@ func callbackRetGeneric(ctx *C.sqlite3_context, v reflect.Value) error {
 	}
 
 	cb, err := callbackRet(v.Elem().Type())
-        if err != nil {
-                return err
-        }
+	if err != nil {
+		return err
+	}
 
-        return cb(ctx, v.Elem())
+	return cb(ctx, v.Elem())
 }
 
 func callbackRet(typ reflect.Type) (callbackRetConverter, error) {
diff --git a/convert.go b/convert.go
index 0385073..f7a9dcd 100644
--- a/convert.go
+++ b/convert.go
@@ -23,7 +23,7 @@ var errNilPtr = errors.New("destination pointer is nil") // embedded in descript
 // convertAssign copies to dest the value in src, converting it if possible.
 // An error is returned if the copy would result in loss of information.
 // dest should be a pointer type.
-func convertAssign(dest, src interface{}) error {
+func convertAssign(dest, src any) error {
 	// Common cases, without reflect.
 	switch s := src.(type) {
 	case string:
@@ -55,7 +55,7 @@ func convertAssign(dest, src interface{}) error {
 			}
 			*d = string(s)
 			return nil
-		case *interface{}:
+		case *any:
 			if d == nil {
 				return errNilPtr
 			}
@@ -97,7 +97,7 @@ func convertAssign(dest, src interface{}) error {
 		}
 	case nil:
 		switch d := dest.(type) {
-		case *interface{}:
+		case *any:
 			if d == nil {
 				return errNilPtr
 			}
@@ -149,7 +149,7 @@ func convertAssign(dest, src interface{}) error {
 			*d = bv.(bool)
 		}
 		return err
-	case *interface{}:
+	case *any:
 		*d = src
 		return nil
 	}
@@ -256,7 +256,7 @@ func cloneBytes(b []byte) []byte {
 	return c
 }
 
-func asString(src interface{}) string {
+func asString(src any) string {
 	switch v := src.(type) {
 	case string:
 		return v
diff --git a/doc.go b/doc.go
index ac27633..a3bcebb 100644
--- a/doc.go
+++ b/doc.go
@@ -5,63 +5,63 @@ This works as a driver for database/sql.
 
 Installation
 
-    go get github.com/mattn/go-sqlite3
+	go get github.com/mattn/go-sqlite3
 
-Supported Types
+# Supported Types
 
 Currently, go-sqlite3 supports the following data types.
 
-    +------------------------------+
-    |go        | sqlite3           |
-    |----------|-------------------|
-    |nil       | null              |
-    |int       | integer           |
-    |int64     | integer           |
-    |float64   | float             |
-    |bool      | integer           |
-    |[]byte    | blob              |
-    |string    | text              |
-    |time.Time | timestamp/datetime|
-    +------------------------------+
-
-SQLite3 Extension
+	+------------------------------+
+	|go        | sqlite3           |
+	|----------|-------------------|
+	|nil       | null              |
+	|int       | integer           |
+	|int64     | integer           |
+	|float64   | float             |
+	|bool      | integer           |
+	|[]byte    | blob              |
+	|string    | text              |
+	|time.Time | timestamp/datetime|
+	+------------------------------+
+
+# SQLite3 Extension
 
 You can write your own extension module for sqlite3. For example, below is an
 extension for a Regexp matcher operation.
 
-    #include <pcre.h>
-    #include <string.h>
-    #include <stdio.h>
-    #include <sqlite3ext.h>
-
-    SQLITE_EXTENSION_INIT1
-    static void regexp_func(sqlite3_context *context, int argc, sqlite3_value **argv) {
-      if (argc >= 2) {
-        const char *target  = (const char *)sqlite3_value_text(argv[1]);
-        const char *pattern = (const char *)sqlite3_value_text(argv[0]);
-        const char* errstr = NULL;
-        int erroff = 0;
-        int vec[500];
-        int n, rc;
-        pcre* re = pcre_compile(pattern, 0, &errstr, &erroff, NULL);
-        rc = pcre_exec(re, NULL, target, strlen(target), 0, 0, vec, 500);
-        if (rc <= 0) {
-          sqlite3_result_error(context, errstr, 0);
-          return;
-        }
-        sqlite3_result_int(context, 1);
-      }
-    }
-
-    #ifdef _WIN32
-    __declspec(dllexport)
-    #endif
-    int sqlite3_extension_init(sqlite3 *db, char **errmsg,
-          const sqlite3_api_routines *api) {
-      SQLITE_EXTENSION_INIT2(api);
-      return sqlite3_create_function(db, "regexp", 2, SQLITE_UTF8,
-          (void*)db, regexp_func, NULL, NULL);
-    }
+	#include <pcre.h>
+	#include <string.h>
+	#include <stdio.h>
+	#include <sqlite3ext.h>
+
+	SQLITE_EXTENSION_INIT1
+	static void regexp_func(sqlite3_context *context, int argc, sqlite3_value **argv) {
+	  if (argc >= 2) {
+	    const char *target  = (const char *)sqlite3_value_text(argv[1]);
+	    const char *pattern = (const char *)sqlite3_value_text(argv[0]);
+	    const char* errstr = NULL;
+	    int erroff = 0;
+	    int vec[500];
+	    int n, rc;
+	    pcre* re = pcre_compile(pattern, 0, &errstr, &erroff, NULL);
+	    rc = pcre_exec(re, NULL, target, strlen(target), 0, 0, vec, 500);
+	    if (rc <= 0) {
+	      sqlite3_result_error(context, errstr, 0);
+	      return;
+	    }
+	    sqlite3_result_int(context, 1);
+	  }
+	}
+
+	#ifdef _WIN32
+	__declspec(dllexport)
+	#endif
+	int sqlite3_extension_init(sqlite3 *db, char **errmsg,
+	      const sqlite3_api_routines *api) {
+	  SQLITE_EXTENSION_INIT2(api);
+	  return sqlite3_create_function(db, "regexp", 2, SQLITE_UTF8,
+	      (void*)db, regexp_func, NULL, NULL);
+	}
 
 It needs to be built as a so/dll shared library. And you need to register
 the extension module like below.
@@ -77,7 +77,7 @@ Then, you can use this extension.
 
 	rows, err := db.Query("select text from mytable where name regexp '^golang'")
 
-Connection Hook
+# Connection Hook
 
 You can hook and inject your code when the connection is established by setting
 ConnectHook to get the SQLiteConn.
@@ -95,13 +95,13 @@ You can also use database/sql.Conn.Raw (Go >= 1.13):
 	conn, err := db.Conn(context.Background())
 	// if err != nil { ... }
 	defer conn.Close()
-	err = conn.Raw(func (driverConn interface{}) error {
+	err = conn.Raw(func (driverConn any) error {
 		sqliteConn := driverConn.(*sqlite3.SQLiteConn)
 		// ... use sqliteConn
 	})
 	// if err != nil { ... }
 
-Go SQlite3 Extensions
+# Go SQlite3 Extensions
 
 If you want to register Go functions as SQLite extension functions
 you can make a custom driver by calling RegisterFunction from
@@ -130,6 +130,5 @@ You can then use the custom driver by passing its name to sql.Open.
 	}
 
 See the documentation of RegisterFunc for more details.
-
 */
 package sqlite3
diff --git a/go.mod b/go.mod
index 89788ab..e342dcc 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 module github.com/mattn/go-sqlite3
 
-go 1.16
+go 1.19
 
 retract (
  [v2.0.0+incompatible, v2.0.6+incompatible] // Accidental; no major changes or features.
diff --git a/sqlite3.go b/sqlite3.go
index 5764182..a16d8ab 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -607,10 +607,9 @@ func (c *SQLiteConn) RegisterAuthorizer(callback func(int, string, string, strin
 // RegisterFunc makes a Go function available as a SQLite function.
 //
 // The Go function can have arguments of the following types: any
-// numeric type except complex, bool, []byte, string and
-// interface{}. interface{} arguments are given the direct translation
-// of the SQLite data type: int64 for INTEGER, float64 for FLOAT,
-// []byte for BLOB, string for TEXT.
+// numeric type except complex, bool, []byte, string and any.
+// any arguments are given the direct translation of the SQLite data type:
+// int64 for INTEGER, float64 for FLOAT, []byte for BLOB, string for TEXT.
 //
 // The function can additionally be variadic, as long as the type of
 // the variadic argument is one of the above.
@@ -620,7 +619,7 @@ func (c *SQLiteConn) RegisterAuthorizer(callback func(int, string, string, strin
 // optimizations in its queries.
 //
 // See _example/go_custom_funcs for a detailed example.
-func (c *SQLiteConn) RegisterFunc(name string, impl interface{}, pure bool) error {
+func (c *SQLiteConn) RegisterFunc(name string, impl any, pure bool) error {
 	var fi functionInfo
 	fi.f = reflect.ValueOf(impl)
 	t := fi.f.Type()
@@ -702,7 +701,7 @@ func sqlite3CreateFunction(db *C.sqlite3, zFunctionName *C.char, nArg C.int, eTe
 // return an error in addition to their other return values.
 //
 // See _example/go_custom_funcs for a detailed example.
-func (c *SQLiteConn) RegisterAggregator(name string, impl interface{}, pure bool) error {
+func (c *SQLiteConn) RegisterAggregator(name string, impl any, pure bool) error {
 	var ai aggInfo
 	ai.constructor = reflect.ValueOf(impl)
 	t := ai.constructor.Type()
@@ -976,103 +975,104 @@ func (c *SQLiteConn) begin(ctx context.Context) (driver.Tx, error) {
 // The argument is may be either in parentheses or it may be separated from
 // the pragma name by an equal sign. The two syntaxes yield identical results.
 // In many pragmas, the argument is a boolean. The boolean can be one of:
-//    1 yes true on
-//    0 no false off
+//
+//	1 yes true on
+//	0 no false off
 //
 // You can specify a DSN string using a URI as the filename.
-//   test.db
-//   file:test.db?cache=shared&mode=memory
-//   :memory:
-//   file::memory:
 //
-//   mode
-//     Access mode of the database.
-//     https://www.sqlite.org/c3ref/open.html
-//     Values:
-//      - ro
-//      - rw
-//      - rwc
-//      - memory
+//	test.db
+//	file:test.db?cache=shared&mode=memory
+//	:memory:
+//	file::memory:
 //
-//   cache
-//     SQLite Shared-Cache Mode
-//     https://www.sqlite.org/sharedcache.html
-//     Values:
-//       - shared
-//       - private
+//	mode
+//	  Access mode of the database.
+//	  https://www.sqlite.org/c3ref/open.html
+//	  Values:
+//	   - ro
+//	   - rw
+//	   - rwc
+//	   - memory
 //
-//   immutable=Boolean
-//     The immutable parameter is a boolean query parameter that indicates
-//     that the database file is stored on read-only media. When immutable is set,
-//     SQLite assumes that the database file cannot be changed,
-//     even by a process with higher privilege,
-//     and so the database is opened read-only and all locking and change detection is disabled.
-//     Caution: Setting the immutable property on a database file that
-//     does in fact change can result in incorrect query results and/or SQLITE_CORRUPT errors.
+//	cache
+//	  SQLite Shared-Cache Mode
+//	  https://www.sqlite.org/sharedcache.html
+//	  Values:
+//	    - shared
+//	    - private
 //
-// go-sqlite3 adds the following query parameters to those used by SQLite:
-//   _loc=XXX
-//     Specify location of time format. It's possible to specify "auto".
+//	immutable=Boolean
+//	  The immutable parameter is a boolean query parameter that indicates
+//	  that the database file is stored on read-only media. When immutable is set,
+//	  SQLite assumes that the database file cannot be changed,
+//	  even by a process with higher privilege,
+//	  and so the database is opened read-only and all locking and change detection is disabled.
+//	  Caution: Setting the immutable property on a database file that
+//	  does in fact change can result in incorrect query results and/or SQLITE_CORRUPT errors.
 //
-//   _mutex=XXX
-//     Specify mutex mode. XXX can be "no", "full".
+// go-sqlite3 adds the following query parameters to those used by SQLite:
 //
-//   _txlock=XXX
-//     Specify locking behavior for transactions.  XXX can be "immediate",
-//     "deferred", "exclusive".
+//	_loc=XXX
+//	  Specify location of time format. It's possible to specify "auto".
 //
-//   _auto_vacuum=X | _vacuum=X
-//     0 | none - Auto Vacuum disabled
-//     1 | full - Auto Vacuum FULL
-//     2 | incremental - Auto Vacuum Incremental
+//	_mutex=XXX
+//	  Specify mutex mode. XXX can be "no", "full".
 //
-//   _busy_timeout=XXX"| _timeout=XXX
-//     Specify value for sqlite3_busy_timeout.
+//	_txlock=XXX
+//	  Specify locking behavior for transactions.  XXX can be "immediate",
+//	  "deferred", "exclusive".
 //
-//   _case_sensitive_like=Boolean | _cslike=Boolean
-//     https://www.sqlite.org/pragma.html#pragma_case_sensitive_like
-//     Default or disabled the LIKE operation is case-insensitive.
-//     When enabling this options behaviour of LIKE will become case-sensitive.
+//	_auto_vacuum=X | _vacuum=X
+//	  0 | none - Auto Vacuum disabled
+//	  1 | full - Auto Vacuum FULL
+//	  2 | incremental - Auto Vacuum Incremental
 //
-//   _defer_foreign_keys=Boolean | _defer_fk=Boolean
-//     Defer Foreign Keys until outermost transaction is committed.
+//	_busy_timeout=XXX"| _timeout=XXX
+//	  Specify value for sqlite3_busy_timeout.
 //
-//   _foreign_keys=Boolean | _fk=Boolean
-//     Enable or disable enforcement of foreign keys.
+//	_case_sensitive_like=Boolean | _cslike=Boolean
+//	  https://www.sqlite.org/pragma.html#pragma_case_sensitive_like
+//	  Default or disabled the LIKE operation is case-insensitive.
+//	  When enabling this options behaviour of LIKE will become case-sensitive.
 //
-//   _ignore_check_constraints=Boolean
-//     This pragma enables or disables the enforcement of CHECK constraints.
-//     The default setting is off, meaning that CHECK constraints are enforced by default.
+//	_defer_foreign_keys=Boolean | _defer_fk=Boolean
+//	  Defer Foreign Keys until outermost transaction is committed.
 //
-//   _journal_mode=MODE | _journal=MODE
-//     Set journal mode for the databases associated with the current connection.
-//     https://www.sqlite.org/pragma.html#pragma_journal_mode
+//	_foreign_keys=Boolean | _fk=Boolean
+//	  Enable or disable enforcement of foreign keys.
 //
-//   _locking_mode=X | _locking=X
-//     Sets the database connection locking-mode.
-//     The locking-mode is either NORMAL or EXCLUSIVE.
-//     https://www.sqlite.org/pragma.html#pragma_locking_mode
+//	_ignore_check_constraints=Boolean
+//	  This pragma enables or disables the enforcement of CHECK constraints.
+//	  The default setting is off, meaning that CHECK constraints are enforced by default.
 //
-//   _query_only=Boolean
-//     The query_only pragma prevents all changes to database files when enabled.
+//	_journal_mode=MODE | _journal=MODE
+//	  Set journal mode for the databases associated with the current connection.
+//	  https://www.sqlite.org/pragma.html#pragma_journal_mode
 //
-//   _recursive_triggers=Boolean | _rt=Boolean
-//     Enable or disable recursive triggers.
+//	_locking_mode=X | _locking=X
+//	  Sets the database connection locking-mode.
+//	  The locking-mode is either NORMAL or EXCLUSIVE.
+//	  https://www.sqlite.org/pragma.html#pragma_locking_mode
 //
-//   _secure_delete=Boolean|FAST
-//     When secure_delete is on, SQLite overwrites deleted content with zeros.
-//     https://www.sqlite.org/pragma.html#pragma_secure_delete
+//	_query_only=Boolean
+//	  The query_only pragma prevents all changes to database files when enabled.
 //
-//   _synchronous=X | _sync=X
-//     Change the setting of the "synchronous" flag.
-//     https://www.sqlite.org/pragma.html#pragma_synchronous
+//	_recursive_triggers=Boolean | _rt=Boolean
+//	  Enable or disable recursive triggers.
 //
-//   _writable_schema=Boolean
-//     When this pragma is on, the SQLITE_MASTER tables in which database
-//     can be changed using ordinary UPDATE, INSERT, and DELETE statements.
-//     Warning: misuse of this pragma can easily result in a corrupt database file.
+//	_secure_delete=Boolean|FAST
+//	  When secure_delete is on, SQLite overwrites deleted content with zeros.
+//	  https://www.sqlite.org/pragma.html#pragma_secure_delete
 //
+//	_synchronous=X | _sync=X
+//	  Change the setting of the "synchronous" flag.
+//	  https://www.sqlite.org/pragma.html#pragma_synchronous
 //
+//	_writable_schema=Boolean
+//	  When this pragma is on, the SQLITE_MASTER tables in which database
+//	  can be changed using ordinary UPDATE, INSERT, and DELETE statements.
+//	  Warning: misuse of this pragma can easily result in a corrupt database file.
 func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
 	if C.sqlite3_threadsafe() == 0 {
 		return nil, errors.New("sqlite library was not compiled for thread-safe operation")
diff --git a/sqlite3_func_crypt.go b/sqlite3_func_crypt.go
index afd9333..bd9a3bc 100644
--- a/sqlite3_func_crypt.go
+++ b/sqlite3_func_crypt.go
@@ -50,15 +50,15 @@ import (
 // perhaps using a cryptographic hash function like SHA1.
 
 // CryptEncoderSHA1 encodes a password with SHA1
-func CryptEncoderSHA1(pass []byte, hash interface{}) []byte {
+func CryptEncoderSHA1(pass []byte, hash any) []byte {
 	h := sha1.Sum(pass)
 	return h[:]
 }
 
 // CryptEncoderSSHA1 encodes a password with SHA1 with the
 // configured salt.
-func CryptEncoderSSHA1(salt string) func(pass []byte, hash interface{}) []byte {
-	return func(pass []byte, hash interface{}) []byte {
+func CryptEncoderSSHA1(salt string) func(pass []byte, hash any) []byte {
+	return func(pass []byte, hash any) []byte {
 		s := []byte(salt)
 		p := append(pass, s...)
 		h := sha1.Sum(p)
@@ -67,15 +67,15 @@ func CryptEncoderSSHA1(salt string) func(pass []byte, hash interface{}) []byte {
 }
 
 // CryptEncoderSHA256 encodes a password with SHA256
-func CryptEncoderSHA256(pass []byte, hash interface{}) []byte {
+func CryptEncoderSHA256(pass []byte, hash any) []byte {
 	h := sha256.Sum256(pass)
 	return h[:]
 }
 
 // CryptEncoderSSHA256 encodes a password with SHA256
 // with the configured salt
-func CryptEncoderSSHA256(salt string) func(pass []byte, hash interface{}) []byte {
-	return func(pass []byte, hash interface{}) []byte {
+func CryptEncoderSSHA256(salt string) func(pass []byte, hash any) []byte {
+	return func(pass []byte, hash any) []byte {
 		s := []byte(salt)
 		p := append(pass, s...)
 		h := sha256.Sum256(p)
@@ -84,15 +84,15 @@ func CryptEncoderSSHA256(salt string) func(pass []byte, hash interface{}) []byte
 }
 
 // CryptEncoderSHA384 encodes a password with SHA384
-func CryptEncoderSHA384(pass []byte, hash interface{}) []byte {
+func CryptEncoderSHA384(pass []byte, hash any) []byte {
 	h := sha512.Sum384(pass)
 	return h[:]
 }
 
 // CryptEncoderSSHA384 encodes a password with SHA384
 // with the configured salt
-func CryptEncoderSSHA384(salt string) func(pass []byte, hash interface{}) []byte {
-	return func(pass []byte, hash interface{}) []byte {
+func CryptEncoderSSHA384(salt string) func(pass []byte, hash any) []byte {
+	return func(pass []byte, hash any) []byte {
 		s := []byte(salt)
 		p := append(pass, s...)
 		h := sha512.Sum384(p)
@@ -101,15 +101,15 @@ func CryptEncoderSSHA384(salt string) func(pass []byte, hash interface{}) []byte
 }
 
 // CryptEncoderSHA512 encodes a password with SHA512
-func CryptEncoderSHA512(pass []byte, hash interface{}) []byte {
+func CryptEncoderSHA512(pass []byte, hash any) []byte {
 	h := sha512.Sum512(pass)
 	return h[:]
 }
 
 // CryptEncoderSSHA512 encodes a password with SHA512
 // with the configured salt
-func CryptEncoderSSHA512(salt string) func(pass []byte, hash interface{}) []byte {
-	return func(pass []byte, hash interface{}) []byte {
+func CryptEncoderSSHA512(salt string) func(pass []byte, hash any) []byte {
+	return func(pass []byte, hash any) []byte {
 		s := []byte(salt)
 		p := append(pass, s...)
 		h := sha512.Sum512(p)
diff --git a/sqlite3_go18.go b/sqlite3_go18.go
index 514fd7e..34cad08 100644
--- a/sqlite3_go18.go
+++ b/sqlite3_go18.go
@@ -3,8 +3,8 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
-// +build cgo
-// +build go1.8
+//go:build cgo && go1.8
+// +build cgo,go1.8
 
 package sqlite3
 
diff --git a/sqlite3_libsqlite3.go b/sqlite3_libsqlite3.go
index ac609c9..95cc7c0 100644
--- a/sqlite3_libsqlite3.go
+++ b/sqlite3_libsqlite3.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build libsqlite3
 // +build libsqlite3
 
 package sqlite3
diff --git a/sqlite3_load_extension.go b/sqlite3_load_extension.go
index 9433fea..03cbc8b 100644
--- a/sqlite3_load_extension.go
+++ b/sqlite3_load_extension.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build !sqlite_omit_load_extension
 // +build !sqlite_omit_load_extension
 
 package sqlite3
diff --git a/sqlite3_load_extension_omit.go b/sqlite3_load_extension_omit.go
index 8c75f9b..d4f8ce6 100644
--- a/sqlite3_load_extension_omit.go
+++ b/sqlite3_load_extension_omit.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_omit_load_extension
 // +build sqlite_omit_load_extension
 
 package sqlite3
diff --git a/sqlite3_opt_allow_uri_authority.go b/sqlite3_opt_allow_uri_authority.go
index 8c4d4d2..51240cb 100644
--- a/sqlite3_opt_allow_uri_authority.go
+++ b/sqlite3_opt_allow_uri_authority.go
@@ -4,6 +4,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_allow_uri_authority
 // +build sqlite_allow_uri_authority
 
 package sqlite3
diff --git a/sqlite3_opt_app_armor.go b/sqlite3_opt_app_armor.go
index 63c80cf..565dbc2 100644
--- a/sqlite3_opt_app_armor.go
+++ b/sqlite3_opt_app_armor.go
@@ -4,8 +4,8 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
-// +build !windows
-// +build sqlite_app_armor
+//go:build !windows && sqlite_app_armor
+// +build !windows,sqlite_app_armor
 
 package sqlite3
 
diff --git a/sqlite3_opt_column_metadata.go b/sqlite3_opt_column_metadata.go
index c67fa82..63659b4 100644
--- a/sqlite3_opt_column_metadata.go
+++ b/sqlite3_opt_column_metadata.go
@@ -1,3 +1,4 @@
+//go:build sqlite_column_metadata
 // +build sqlite_column_metadata
 
 package sqlite3
diff --git a/sqlite3_opt_foreign_keys.go b/sqlite3_opt_foreign_keys.go
index a676e09..82c944e 100644
--- a/sqlite3_opt_foreign_keys.go
+++ b/sqlite3_opt_foreign_keys.go
@@ -4,6 +4,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_foreign_keys
 // +build sqlite_foreign_keys
 
 package sqlite3
diff --git a/sqlite3_opt_fts5.go b/sqlite3_opt_fts5.go
index 0f38df7..2645f28 100644
--- a/sqlite3_opt_fts5.go
+++ b/sqlite3_opt_fts5.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_fts5 || fts5
 // +build sqlite_fts5 fts5
 
 package sqlite3
diff --git a/sqlite3_opt_icu.go b/sqlite3_opt_icu.go
index f82bdd0..2d47827 100644
--- a/sqlite3_opt_icu.go
+++ b/sqlite3_opt_icu.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_icu || icu
 // +build sqlite_icu icu
 
 package sqlite3
diff --git a/sqlite3_opt_introspect.go b/sqlite3_opt_introspect.go
index 6512b2b..cd2e540 100644
--- a/sqlite3_opt_introspect.go
+++ b/sqlite3_opt_introspect.go
@@ -4,6 +4,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_introspect
 // +build sqlite_introspect
 
 package sqlite3
diff --git a/sqlite3_opt_math_functions.go b/sqlite3_opt_math_functions.go
index 7cd68d3..bd62d9a 100644
--- a/sqlite3_opt_math_functions.go
+++ b/sqlite3_opt_math_functions.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_math_functions
 // +build sqlite_math_functions
 
 package sqlite3
diff --git a/sqlite3_opt_preupdate.go b/sqlite3_opt_preupdate.go
index cea032e..ed725ee 100644
--- a/sqlite3_opt_preupdate.go
+++ b/sqlite3_opt_preupdate.go
@@ -4,6 +4,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build cgo
 // +build cgo
 
 package sqlite3
diff --git a/sqlite3_opt_preupdate_hook.go b/sqlite3_opt_preupdate_hook.go
index b43e482..8cce278 100644
--- a/sqlite3_opt_preupdate_hook.go
+++ b/sqlite3_opt_preupdate_hook.go
@@ -4,6 +4,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_preupdate_hook
 // +build sqlite_preupdate_hook
 
 package sqlite3
@@ -54,10 +55,10 @@ func (d *SQLitePreUpdateData) Count() int {
 	return int(C.sqlite3_preupdate_count(d.Conn.db))
 }
 
-func (d *SQLitePreUpdateData) row(dest []interface{}, new bool) error {
+func (d *SQLitePreUpdateData) row(dest []any, new bool) error {
 	for i := 0; i < d.Count() && i < len(dest); i++ {
 		var val *C.sqlite3_value
-		var src interface{}
+		var src any
 
 		// Initially I tried making this just a function pointer argument, but
 		// it's absurdly complicated to pass C function pointers.
@@ -95,7 +96,7 @@ func (d *SQLitePreUpdateData) row(dest []interface{}, new bool) error {
 
 // Old populates dest with the row data to be replaced. This works similar to
 // database/sql's Rows.Scan()
-func (d *SQLitePreUpdateData) Old(dest ...interface{}) error {
+func (d *SQLitePreUpdateData) Old(dest ...any) error {
 	if d.Op == SQLITE_INSERT {
 		return errors.New("There is no old row for INSERT operations")
 	}
@@ -104,7 +105,7 @@ func (d *SQLitePreUpdateData) Old(dest ...interface{}) error {
 
 // New populates dest with the replacement row data. This works similar to
 // database/sql's Rows.Scan()
-func (d *SQLitePreUpdateData) New(dest ...interface{}) error {
+func (d *SQLitePreUpdateData) New(dest ...any) error {
 	if d.Op == SQLITE_DELETE {
 		return errors.New("There is no new row for DELETE operations")
 	}
diff --git a/sqlite3_opt_preupdate_omit.go b/sqlite3_opt_preupdate_omit.go
index c510a15..f60da6c 100644
--- a/sqlite3_opt_preupdate_omit.go
+++ b/sqlite3_opt_preupdate_omit.go
@@ -4,6 +4,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build !sqlite_preupdate_hook && cgo
 // +build !sqlite_preupdate_hook,cgo
 
 package sqlite3
diff --git a/sqlite3_opt_secure_delete.go b/sqlite3_opt_secure_delete.go
index 934fa6b..6bb05b8 100644
--- a/sqlite3_opt_secure_delete.go
+++ b/sqlite3_opt_secure_delete.go
@@ -4,6 +4,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_secure_delete
 // +build sqlite_secure_delete
 
 package sqlite3
diff --git a/sqlite3_opt_secure_delete_fast.go b/sqlite3_opt_secure_delete_fast.go
index b0de130..982020a 100644
--- a/sqlite3_opt_secure_delete_fast.go
+++ b/sqlite3_opt_secure_delete_fast.go
@@ -4,6 +4,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_secure_delete_fast
 // +build sqlite_secure_delete_fast
 
 package sqlite3
diff --git a/sqlite3_opt_serialize.go b/sqlite3_opt_serialize.go
index 2560c43..f1710c1 100644
--- a/sqlite3_opt_serialize.go
+++ b/sqlite3_opt_serialize.go
@@ -1,3 +1,4 @@
+//go:build !libsqlite3 || sqlite_serialize
 // +build !libsqlite3 sqlite_serialize
 
 package sqlite3
diff --git a/sqlite3_opt_serialize_omit.go b/sqlite3_opt_serialize_omit.go
index b154dd3..d00ead0 100644
--- a/sqlite3_opt_serialize_omit.go
+++ b/sqlite3_opt_serialize_omit.go
@@ -1,3 +1,4 @@
+//go:build libsqlite3 && !sqlite_serialize
 // +build libsqlite3,!sqlite_serialize
 
 package sqlite3
diff --git a/sqlite3_opt_stat4.go b/sqlite3_opt_stat4.go
index d4d30f0..799fbb0 100644
--- a/sqlite3_opt_stat4.go
+++ b/sqlite3_opt_stat4.go
@@ -4,6 +4,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_stat4
 // +build sqlite_stat4
 
 package sqlite3
diff --git a/sqlite3_opt_unlock_notify.go b/sqlite3_opt_unlock_notify.go
index adfa26c..76f7bbf 100644
--- a/sqlite3_opt_unlock_notify.go
+++ b/sqlite3_opt_unlock_notify.go
@@ -3,8 +3,8 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
-// +build cgo
-// +build sqlite_unlock_notify
+//go:build cgo && sqlite_unlock_notify
+// +build cgo,sqlite_unlock_notify
 
 package sqlite3
 
diff --git a/sqlite3_opt_userauth.go b/sqlite3_opt_userauth.go
index b62b608..de9630c 100644
--- a/sqlite3_opt_userauth.go
+++ b/sqlite3_opt_userauth.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_userauth
 // +build sqlite_userauth
 
 package sqlite3
@@ -79,7 +80,7 @@ var (
 // If a database contains the SQLITE_USER table, then the
 // call to Authenticate must be invoked with an
 // appropriate username and password prior to enable read and write
-//access to the database.
+// access to the database.
 //
 // Return SQLITE_OK on success or SQLITE_ERROR if the username/password
 // combination is incorrect or unknown.
@@ -103,9 +104,10 @@ func (c *SQLiteConn) Authenticate(username, password string) error {
 // It is however exported for usage within SQL by the user.
 //
 // Returns:
-//	C.SQLITE_OK (0)
-//	C.SQLITE_ERROR (1)
-//  C.SQLITE_AUTH (23)
+//
+//		C.SQLITE_OK (0)
+//		C.SQLITE_ERROR (1)
+//	 C.SQLITE_AUTH (23)
 func (c *SQLiteConn) authenticate(username, password string) int {
 	// Allocate C Variables
 	cuser := C.CString(username)
@@ -155,9 +157,10 @@ func (c *SQLiteConn) AuthUserAdd(username, password string, admin bool) error {
 // It is however exported for usage within SQL by the user.
 //
 // Returns:
-//	C.SQLITE_OK (0)
-//	C.SQLITE_ERROR (1)
-//  C.SQLITE_AUTH (23)
+//
+//		C.SQLITE_OK (0)
+//		C.SQLITE_ERROR (1)
+//	 C.SQLITE_AUTH (23)
 func (c *SQLiteConn) authUserAdd(username, password string, admin int) int {
 	// Allocate C Variables
 	cuser := C.CString(username)
@@ -207,9 +210,10 @@ func (c *SQLiteConn) AuthUserChange(username, password string, admin bool) error
 // It is however exported for usage within SQL by the user.
 //
 // Returns:
-//	C.SQLITE_OK (0)
-//	C.SQLITE_ERROR (1)
-//  C.SQLITE_AUTH (23)
+//
+//		C.SQLITE_OK (0)
+//		C.SQLITE_ERROR (1)
+//	 C.SQLITE_AUTH (23)
 func (c *SQLiteConn) authUserChange(username, password string, admin int) int {
 	// Allocate C Variables
 	cuser := C.CString(username)
@@ -249,9 +253,10 @@ func (c *SQLiteConn) AuthUserDelete(username string) error {
 // It is however exported for usage within SQL by the user.
 //
 // Returns:
-//	C.SQLITE_OK (0)
-//	C.SQLITE_ERROR (1)
-//  C.SQLITE_AUTH (23)
+//
+//		C.SQLITE_OK (0)
+//		C.SQLITE_ERROR (1)
+//	 C.SQLITE_AUTH (23)
 func (c *SQLiteConn) authUserDelete(username string) int {
 	// Allocate C Variables
 	cuser := C.CString(username)
@@ -280,8 +285,9 @@ func (c *SQLiteConn) AuthEnabled() (exists bool) {
 // It is however exported for usage within SQL by the user.
 //
 // Returns:
-//	0 - Disabled
-//  1 - Enabled
+//
+//		0 - Disabled
+//	 1 - Enabled
 func (c *SQLiteConn) authEnabled() int {
 	return int(C._sqlite3_auth_enabled(c.db))
 }
diff --git a/sqlite3_opt_userauth_omit.go b/sqlite3_opt_userauth_omit.go
index 302cd57..15370df 100644
--- a/sqlite3_opt_userauth_omit.go
+++ b/sqlite3_opt_userauth_omit.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build !sqlite_userauth
 // +build !sqlite_userauth
 
 package sqlite3
@@ -17,7 +18,7 @@ import (
 // If a database contains the SQLITE_USER table, then the
 // call to Authenticate must be invoked with an
 // appropriate username and password prior to enable read and write
-//access to the database.
+// access to the database.
 //
 // Return SQLITE_OK on success or SQLITE_ERROR if the username/password
 // combination is incorrect or unknown.
@@ -34,9 +35,10 @@ func (c *SQLiteConn) Authenticate(username, password string) error {
 // It is however exported for usage within SQL by the user.
 //
 // Returns:
-//	C.SQLITE_OK (0)
-//	C.SQLITE_ERROR (1)
-//  C.SQLITE_AUTH (23)
+//
+//		C.SQLITE_OK (0)
+//		C.SQLITE_ERROR (1)
+//	 C.SQLITE_AUTH (23)
 func (c *SQLiteConn) authenticate(username, password string) int {
 	// NOOP
 	return 0
@@ -65,9 +67,10 @@ func (c *SQLiteConn) AuthUserAdd(username, password string, admin bool) error {
 // It is however exported for usage within SQL by the user.
 //
 // Returns:
-//	C.SQLITE_OK (0)
-//	C.SQLITE_ERROR (1)
-//  C.SQLITE_AUTH (23)
+//
+//		C.SQLITE_OK (0)
+//		C.SQLITE_ERROR (1)
+//	 C.SQLITE_AUTH (23)
 func (c *SQLiteConn) authUserAdd(username, password string, admin int) int {
 	// NOOP
 	return 0
@@ -96,9 +99,10 @@ func (c *SQLiteConn) AuthUserChange(username, password string, admin bool) error
 // It is however exported for usage within SQL by the user.
 //
 // Returns:
-//	C.SQLITE_OK (0)
-//	C.SQLITE_ERROR (1)
-//  C.SQLITE_AUTH (23)
+//
+//		C.SQLITE_OK (0)
+//		C.SQLITE_ERROR (1)
+//	 C.SQLITE_AUTH (23)
 func (c *SQLiteConn) authUserChange(username, password string, admin int) int {
 	// NOOP
 	return 0
@@ -122,9 +126,10 @@ func (c *SQLiteConn) AuthUserDelete(username string) error {
 // It is however exported for usage within SQL by the user.
 //
 // Returns:
-//	C.SQLITE_OK (0)
-//	C.SQLITE_ERROR (1)
-//  C.SQLITE_AUTH (23)
+//
+//		C.SQLITE_OK (0)
+//		C.SQLITE_ERROR (1)
+//	 C.SQLITE_AUTH (23)
 func (c *SQLiteConn) authUserDelete(username string) int {
 	// NOOP
 	return 0
@@ -142,8 +147,9 @@ func (c *SQLiteConn) AuthEnabled() (exists bool) {
 // It is however exported for usage within SQL by the user.
 //
 // Returns:
-//	0 - Disabled
-//  1 - Enabled
+//
+//		0 - Disabled
+//	 1 - Enabled
 func (c *SQLiteConn) authEnabled() int {
 	// NOOP
 	return 0
diff --git a/sqlite3_opt_vacuum_full.go b/sqlite3_opt_vacuum_full.go
index 5185a96..df13c9d 100644
--- a/sqlite3_opt_vacuum_full.go
+++ b/sqlite3_opt_vacuum_full.go
@@ -4,6 +4,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_vacuum_full
 // +build sqlite_vacuum_full
 
 package sqlite3
diff --git a/sqlite3_opt_vacuum_incr.go b/sqlite3_opt_vacuum_incr.go
index a9d8a18..a2e4881 100644
--- a/sqlite3_opt_vacuum_incr.go
+++ b/sqlite3_opt_vacuum_incr.go
@@ -4,6 +4,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_vacuum_incr
 // +build sqlite_vacuum_incr
 
 package sqlite3
diff --git a/sqlite3_opt_vtable.go b/sqlite3_opt_vtable.go
index 4a93c46..9b164b3 100644
--- a/sqlite3_opt_vtable.go
+++ b/sqlite3_opt_vtable.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_vtable || vtable
 // +build sqlite_vtable vtable
 
 package sqlite3
@@ -516,7 +517,7 @@ func goMDestroy(pClientData unsafe.Pointer) {
 func goVFilter(pCursor unsafe.Pointer, idxNum C.int, idxName *C.char, argc C.int, argv **C.sqlite3_value) *C.char {
 	vtc := lookupHandle(pCursor).(*sqliteVTabCursor)
 	args := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.sqlite3_value)(nil))]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc]
-	vals := make([]interface{}, 0, argc)
+	vals := make([]any, 0, argc)
 	for _, v := range args {
 		conv, err := callbackArgGeneric(v)
 		if err != nil {
@@ -588,7 +589,7 @@ func goVUpdate(pVTab unsafe.Pointer, argc C.int, argv **C.sqlite3_value, pRowid
 	if v, ok := vt.vTab.(VTabUpdater); ok {
 		// convert argv
 		args := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.sqlite3_value)(nil))]*C.sqlite3_value)(unsafe.Pointer(argv))[:argc:argc]
-		vals := make([]interface{}, 0, argc)
+		vals := make([]any, 0, argc)
 		for _, v := range args {
 			conv, err := callbackArgGeneric(v)
 			if err != nil {
@@ -662,9 +663,9 @@ type VTab interface {
 // deleted.
 // See: https://sqlite.org/vtab.html#xupdate
 type VTabUpdater interface {
-	Delete(interface{}) error
-	Insert(interface{}, []interface{}) (int64, error)
-	Update(interface{}, []interface{}) error
+	Delete(any) error
+	Insert(any, []any) (int64, error)
+	Update(any, []any) error
 }
 
 // VTabCursor describes cursors that point into the virtual table and are used
@@ -673,7 +674,7 @@ type VTabCursor interface {
 	// http://sqlite.org/vtab.html#xclose
 	Close() error
 	// http://sqlite.org/vtab.html#xfilter
-	Filter(idxNum int, idxStr string, vals []interface{}) error
+	Filter(idxNum int, idxStr string, vals []any) error
 	// http://sqlite.org/vtab.html#xnext
 	Next() error
 	// http://sqlite.org/vtab.html#xeof
diff --git a/sqlite3_other.go b/sqlite3_other.go
index 077d3c6..1f9a755 100644
--- a/sqlite3_other.go
+++ b/sqlite3_other.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build !windows
 // +build !windows
 
 package sqlite3
diff --git a/sqlite3_solaris.go b/sqlite3_solaris.go
index 102f90c..fb4d325 100644
--- a/sqlite3_solaris.go
+++ b/sqlite3_solaris.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build solaris
 // +build solaris
 
 package sqlite3
diff --git a/sqlite3_trace.go b/sqlite3_trace.go
index 56bb914..6c47cce 100644
--- a/sqlite3_trace.go
+++ b/sqlite3_trace.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_trace || trace
 // +build sqlite_trace trace
 
 package sqlite3
diff --git a/sqlite3_type.go b/sqlite3_type.go
index 0fd8210..20537a0 100644
--- a/sqlite3_type.go
+++ b/sqlite3_type.go
@@ -74,7 +74,7 @@ func scanType(cdt string) reflect.Type {
 	case SQLITE_TIME:
 		return reflect.TypeOf(sql.NullTime{})
 	}
-	return reflect.TypeOf(new(interface{}))
+	return reflect.TypeOf(new(any))
 }
 
 func databaseTypeConvSqlite(t string) int {
diff --git a/sqlite3_usleep_windows.go b/sqlite3_usleep_windows.go
index b6739bf..6527f6f 100644
--- a/sqlite3_usleep_windows.go
+++ b/sqlite3_usleep_windows.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build cgo
 // +build cgo
 
 package sqlite3
diff --git a/sqlite3_windows.go b/sqlite3_windows.go
index 81aa2ab..f863bcd 100644
--- a/sqlite3_windows.go
+++ b/sqlite3_windows.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build windows
 // +build windows
 
 package sqlite3
diff --git a/static_mock.go b/static_mock.go
index f19e842..d2c5a27 100644
--- a/static_mock.go
+++ b/static_mock.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build !cgo
 // +build !cgo
 
 package sqlite3
@@ -28,10 +29,10 @@ type (
 )
 
 func (SQLiteDriver) Open(s string) (driver.Conn, error)                        { return nil, errorMsg }
-func (c *SQLiteConn) RegisterAggregator(string, interface{}, bool) error       { return errorMsg }
+func (c *SQLiteConn) RegisterAggregator(string, any, bool) error               { return errorMsg }
 func (c *SQLiteConn) RegisterAuthorizer(func(int, string, string, string) int) {}
 func (c *SQLiteConn) RegisterCollation(string, func(string, string) int) error { return errorMsg }
 func (c *SQLiteConn) RegisterCommitHook(func() int)                            {}
-func (c *SQLiteConn) RegisterFunc(string, interface{}, bool) error             { return errorMsg }
+func (c *SQLiteConn) RegisterFunc(string, any, bool) error                     { return errorMsg }
 func (c *SQLiteConn) RegisterRollbackHook(func())                              {}
 func (c *SQLiteConn) RegisterUpdateHook(func(int, string, string, int64))      {}
diff --git a/upgrade/go.mod b/upgrade/go.mod
index caf97ff..1413ffa 100644
--- a/upgrade/go.mod
+++ b/upgrade/go.mod
@@ -1,5 +1,5 @@
 module github.com/mattn/go-sqlite3/upgrade
 
-go 1.16
+go 1.19
 
 require github.com/PuerkitoBio/goquery v1.7.1 // indirect


Test patch:
diff --git a/backup_test.go b/backup_test.go
index 6d857de..b3ad0b5 100644
--- a/backup_test.go
+++ b/backup_test.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build cgo
 // +build cgo
 
 package sqlite3
diff --git a/callback_test.go b/callback_test.go
index b09122a..8163f2f 100644
--- a/callback_test.go
+++ b/callback_test.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build cgo
 // +build cgo
 
 package sqlite3
@@ -53,7 +54,7 @@ func TestCallbackArgCast(t *testing.T) {
 
 func TestCallbackConverters(t *testing.T) {
 	tests := []struct {
-		v   interface{}
+		v   any
 		err bool
 	}{
 		// Unfortunately, we can't tell which converter was returned,
@@ -104,7 +105,7 @@ func TestCallbackConverters(t *testing.T) {
 }
 
 func TestCallbackReturnAny(t *testing.T) {
-	udf := func() interface{} {
+	udf := func() any {
 		return 1
 	}
 
diff --git a/error_test.go b/error_test.go
index 3cfad06..0ff14c1 100644
--- a/error_test.go
+++ b/error_test.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build cgo
 // +build cgo
 
 package sqlite3
diff --git a/sqlite3_func_crypt_test.go b/sqlite3_func_crypt_test.go
index 0329ca8..e37b467 100644
--- a/sqlite3_func_crypt_test.go
+++ b/sqlite3_func_crypt_test.go
@@ -29,7 +29,7 @@ func TestCryptEncoders(t *testing.T) {
 	}
 
 	for _, e := range tests {
-		var fn func(pass []byte, hash interface{}) []byte
+		var fn func(pass []byte, hash any) []byte
 		switch e.enc {
 		case "sha1":
 			fn = CryptEncoderSHA1
diff --git a/sqlite3_go113_test.go b/sqlite3_go113_test.go
index a010cb7..f38d6d1 100644
--- a/sqlite3_go113_test.go
+++ b/sqlite3_go113_test.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build go1.13 && cgo
 // +build go1.13,cgo
 
 package sqlite3
@@ -45,7 +46,7 @@ func TestBeginTxCancel(t *testing.T) {
 				}
 			}()
 
-			err = conn.Raw(func(driverConn interface{}) error {
+			err = conn.Raw(func(driverConn any) error {
 				d, ok := driverConn.(driver.ConnBeginTx)
 				if !ok {
 					t.Fatal("unexpected: wrong type")
@@ -96,7 +97,7 @@ func TestStmtReadonly(t *testing.T) {
 		}
 
 		var ro bool
-		c.Raw(func(dc interface{}) error {
+		c.Raw(func(dc any) error {
 			stmt, err := dc.(*SQLiteConn).Prepare(query)
 			if err != nil {
 				return err
diff --git a/sqlite3_go18_test.go b/sqlite3_go18_test.go
index 8c8c451..eec7479 100644
--- a/sqlite3_go18_test.go
+++ b/sqlite3_go18_test.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build go1.8 && cgo
 // +build go1.8,cgo
 
 package sqlite3
diff --git a/sqlite3_load_extension_test.go b/sqlite3_load_extension_test.go
index 97b1123..c6c03bb 100644
--- a/sqlite3_load_extension_test.go
+++ b/sqlite3_load_extension_test.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build !sqlite_omit_load_extension
 // +build !sqlite_omit_load_extension
 
 package sqlite3
diff --git a/sqlite3_opt_column_metadata_test.go b/sqlite3_opt_column_metadata_test.go
index 28767f1..0a9eec6 100644
--- a/sqlite3_opt_column_metadata_test.go
+++ b/sqlite3_opt_column_metadata_test.go
@@ -1,3 +1,4 @@
+//go:build sqlite_column_metadata
 // +build sqlite_column_metadata
 
 package sqlite3
diff --git a/sqlite3_opt_fts3_test.go b/sqlite3_opt_fts3_test.go
index ce44474..a7b31a7 100644
--- a/sqlite3_opt_fts3_test.go
+++ b/sqlite3_opt_fts3_test.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build cgo
 // +build cgo
 
 package sqlite3
diff --git a/sqlite3_opt_math_functions_test.go b/sqlite3_opt_math_functions_test.go
index 6ff076b..09dbd8d 100644
--- a/sqlite3_opt_math_functions_test.go
+++ b/sqlite3_opt_math_functions_test.go
@@ -1,3 +1,4 @@
+//go:build sqlite_math_functions
 // +build sqlite_math_functions
 
 package sqlite3
diff --git a/sqlite3_opt_preupdate_hook_test.go b/sqlite3_opt_preupdate_hook_test.go
index 20c8766..4892602 100644
--- a/sqlite3_opt_preupdate_hook_test.go
+++ b/sqlite3_opt_preupdate_hook_test.go
@@ -4,6 +4,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_preupdate_hook
 // +build sqlite_preupdate_hook
 
 package sqlite3
@@ -18,8 +19,8 @@ type preUpdateHookDataForTest struct {
 	tableName    string
 	count        int
 	op           int
-	oldRow       []interface{}
-	newRow       []interface{}
+	oldRow       []any
+	newRow       []any
 }
 
 func TestPreUpdateHook(t *testing.T) {
@@ -29,7 +30,7 @@ func TestPreUpdateHook(t *testing.T) {
 		ConnectHook: func(conn *SQLiteConn) error {
 			conn.RegisterPreUpdateHook(func(data SQLitePreUpdateData) {
 				eval := -1
-				oldRow := []interface{}{eval}
+				oldRow := []any{eval}
 				if data.Op != SQLITE_INSERT {
 					err := data.Old(oldRow...)
 					if err != nil {
@@ -38,7 +39,7 @@ func TestPreUpdateHook(t *testing.T) {
 				}
 
 				eval2 := -1
-				newRow := []interface{}{eval2}
+				newRow := []any{eval2}
 				if data.Op != SQLITE_DELETE {
 					err := data.New(newRow...)
 					if err != nil {
@@ -47,7 +48,7 @@ func TestPreUpdateHook(t *testing.T) {
 				}
 
 				// tests dest bound checks in loop
-				var tooSmallRow []interface{}
+				var tooSmallRow []any
 				if data.Op != SQLITE_INSERT {
 					err := data.Old(tooSmallRow...)
 					if err != nil {
diff --git a/sqlite3_opt_serialize_test.go b/sqlite3_opt_serialize_test.go
index 624c5a9..5c7efec 100644
--- a/sqlite3_opt_serialize_test.go
+++ b/sqlite3_opt_serialize_test.go
@@ -1,3 +1,4 @@
+//go:build !libsqlite3 || sqlite_serialize
 // +build !libsqlite3 sqlite_serialize
 
 package sqlite3
@@ -54,7 +55,7 @@ func TestSerializeDeserialize(t *testing.T) {
 	defer srcConn.Close()
 
 	var serialized []byte
-	if err := srcConn.Raw(func(raw interface{}) error {
+	if err := srcConn.Raw(func(raw any) error {
 		var err error
 		serialized, err = raw.(*SQLiteConn).Serialize("")
 		return err
@@ -80,7 +81,7 @@ func TestSerializeDeserialize(t *testing.T) {
 	}
 	defer destConn.Close()
 
-	if err := destConn.Raw(func(raw interface{}) error {
+	if err := destConn.Raw(func(raw any) error {
 		return raw.(*SQLiteConn).Deserialize(serialized, "")
 	}); err != nil {
 		t.Fatal("Failed to deserialize source database:", err)
diff --git a/sqlite3_opt_unlock_notify_test.go b/sqlite3_opt_unlock_notify_test.go
index 95db938..3a9168c 100644
--- a/sqlite3_opt_unlock_notify_test.go
+++ b/sqlite3_opt_unlock_notify_test.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_unlock_notify
 // +build sqlite_unlock_notify
 
 package sqlite3
diff --git a/sqlite3_opt_userauth_test.go b/sqlite3_opt_userauth_test.go
index 543f48e..12e1151 100644
--- a/sqlite3_opt_userauth_test.go
+++ b/sqlite3_opt_userauth_test.go
@@ -3,6 +3,7 @@
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
 
+//go:build sqlite_userauth
 // +build sqlite_userauth
 
 package sqlite3
diff --git a/sqlite3_opt_vtable_test.go b/sqlite3_opt_vtable_test.go
index aae646d..64511e2 100644
--- a/sqlite3_opt_vtable_test.go
+++ b/sqlite3_opt_vtable_test.go
@@ -98,7 +98,7 @@ func (vc *testVTabCursor) Close() error {
 	return nil
 }
 
-func (vc *testVTabCursor) Filter(idxNum int, idxStr string, vals []interface{}) error {
+func (vc *testVTabCursor) Filter(idxNum int, idxStr string, vals []any) error {
 	vc.index = 0
 	return nil
 }
@@ -236,10 +236,10 @@ func TestVUpdate(t *testing.T) {
 	if len(vt.data) != 2 {
 		t.Fatalf("expected table vt to have exactly 2 rows, got: %d", len(vt.data))
 	}
-	if !reflect.DeepEqual(vt.data[0], []interface{}{int64(115), "b", "c"}) {
+	if !reflect.DeepEqual(vt.data[0], []any{int64(115), "b", "c"}) {
 		t.Fatalf("expected table vt entry 0 to be [115 b c], instead: %v", vt.data[0])
 	}
-	if !reflect.DeepEqual(vt.data[1], []interface{}{int64(116), "d", "e"}) {
+	if !reflect.DeepEqual(vt.data[1], []any{int64(116), "d", "e"}) {
 		t.Fatalf("expected table vt entry 1 to be [116 d e], instead: %v", vt.data[1])
 	}
 
@@ -273,10 +273,10 @@ func TestVUpdate(t *testing.T) {
 	if len(vt.data) != 2 {
 		t.Fatalf("expected table vt to have exactly 2 rows, got: %d", len(vt.data))
 	}
-	if !reflect.DeepEqual(vt.data[0], []interface{}{int64(115), "b", "c"}) {
+	if !reflect.DeepEqual(vt.data[0], []any{int64(115), "b", "c"}) {
 		t.Fatalf("expected table vt entry 0 to be [115 b c], instead: %v", vt.data[0])
 	}
-	if !reflect.DeepEqual(vt.data[1], []interface{}{int64(117), "f", "e"}) {
+	if !reflect.DeepEqual(vt.data[1], []any{int64(117), "f", "e"}) {
 		t.Fatalf("expected table vt entry 1 to be [117 f e], instead: %v", vt.data[1])
 	}
 
@@ -297,7 +297,7 @@ func TestVUpdate(t *testing.T) {
 	if len(vt.data) != 1 {
 		t.Fatalf("expected table vt to have exactly 1 row, got: %d", len(vt.data))
 	}
-	if !reflect.DeepEqual(vt.data[0], []interface{}{int64(115), "b", "c"}) {
+	if !reflect.DeepEqual(vt.data[0], []any{int64(115), "b", "c"}) {
 		t.Fatalf("expected table vt entry 0 to be [115 b c], instead: %v", vt.data[0])
 	}
 
@@ -353,7 +353,7 @@ func (m *vtabUpdateModule) Create(c *SQLiteConn, args []string) (VTab, error) {
 	}
 
 	// create table
-	vtab := &vtabUpdateTable{m.t, dbname, tname, cols, typs, make([][]interface{}, 0)}
+	vtab := &vtabUpdateTable{m.t, dbname, tname, cols, typs, make([][]any, 0)}
 	m.tables[tname] = vtab
 	return vtab, nil
 }
@@ -370,7 +370,7 @@ type vtabUpdateTable struct {
 	name string
 	cols []string
 	typs []string
-	data [][]interface{}
+	data [][]any
 }
 
 func (t *vtabUpdateTable) Open() (VTabCursor, error) {
@@ -389,7 +389,7 @@ func (t *vtabUpdateTable) Destroy() error {
 	return nil
 }
 
-func (t *vtabUpdateTable) Insert(id interface{}, vals []interface{}) (int64, error) {
+func (t *vtabUpdateTable) Insert(id any, vals []any) (int64, error) {
 	var i int64
 	if id == nil {
 		i, t.data = int64(len(t.data)), append(t.data, vals)
@@ -407,7 +407,7 @@ func (t *vtabUpdateTable) Insert(id interface{}, vals []interface{}) (int64, err
 	return i, nil
 }
 
-func (t *vtabUpdateTable) Update(id interface{}, vals []interface{}) error {
+func (t *vtabUpdateTable) Update(id any, vals []any) error {
 	i, ok := id.(int64)
 	if !ok {
 		return fmt.Errorf("id is invalid type: %T", id)
@@ -422,7 +422,7 @@ func (t *vtabUpdateTable) Update(id interface{}, vals []interface{}) error {
 	return nil
 }
 
-func (t *vtabUpdateTable) Delete(id interface{}) error {
+func (t *vtabUpdateTable) Delete(id any) error {
 	i, ok := id.(int64)
 	if !ok {
 		return fmt.Errorf("id is invalid type: %T", id)
@@ -465,7 +465,7 @@ func (c *vtabUpdateCursor) Column(ctxt *SQLiteContext, col int) error {
 	return nil
 }
 
-func (c *vtabUpdateCursor) Filter(ixNum int, ixName string, vals []interface{}) error {
+func (c *vtabUpdateCursor) Filter(ixNum int, ixName string, vals []any) error {
 	return nil
 }
 
@@ -547,7 +547,7 @@ func (vc *testVTabCursorEponymousOnly) Close() error {
 	return nil
 }
 
-func (vc *testVTabCursorEponymousOnly) Filter(idxNum int, idxStr string, vals []interface{}) error {
+func (vc *testVTabCursorEponymousOnly) Filter(idxNum int, idxStr string, vals []any) error {
 	vc.index = 0
 	return nil
 }
diff --git a/sqlite3_test.go b/sqlite3_test.go
index 326361e..63c939d 100644
--- a/sqlite3_test.go
+++ b/sqlite3_test.go
@@ -625,7 +625,7 @@ func TestTimestamp(t *testing.T) {
 	timestamp3 := time.Date(2012, time.November, 4, 0, 0, 0, 0, time.UTC)
 	tzTest := time.FixedZone("TEST", -9*3600-13*60)
 	tests := []struct {
-		value    interface{}
+		value    any
 		expected time.Time
 	}{
 		{"nonsense", time.Time{}},
@@ -827,7 +827,7 @@ func TestFloat32(t *testing.T) {
 		t.Fatal("Unable to query results:", err)
 	}
 
-	var id interface{}
+	var id any
 	if err := rows.Scan(&id); err != nil {
 		t.Fatal("Unable to scan results:", err)
 	}
@@ -854,7 +854,7 @@ func TestNull(t *testing.T) {
 		t.Fatal("Unable to query results:", err)
 	}
 
-	var v interface{}
+	var v any
 	if err := rows.Scan(&v); err != nil {
 		t.Fatal("Unable to scan results:", err)
 	}
@@ -998,7 +998,7 @@ func TestTimezoneConversion(t *testing.T) {
 		timestamp2 := time.Date(2006, time.January, 2, 15, 4, 5, 123456789, time.UTC)
 		timestamp3 := time.Date(2012, time.November, 4, 0, 0, 0, 0, time.UTC)
 		tests := []struct {
-			value    interface{}
+			value    any
 			expected time.Time
 		}{
 			{"nonsense", time.Time{}.In(loc)},
@@ -1128,7 +1128,7 @@ func TestQueryer(t *testing.T) {
 		if err != nil {
 			t.Error("Failed to db.Query:", err)
 		}
-		if id != n + 1 {
+		if id != n+1 {
 			t.Error("Failed to db.Query: not matched results")
 		}
 		n = n + 1
@@ -1291,7 +1291,7 @@ const CurrentTimeStamp = "2006-01-02 15:04:05"
 
 type TimeStamp struct{ *time.Time }
 
-func (t TimeStamp) Scan(value interface{}) error {
+func (t TimeStamp) Scan(value any) error {
 	var err error
 	switch v := value.(type) {
 	case string:
@@ -1335,7 +1335,7 @@ func TestFunctionRegistration(t *testing.T) {
 	regex := func(re, s string) (bool, error) {
 		return regexp.MatchString(re, s)
 	}
-	generic := func(a interface{}) int64 {
+	generic := func(a any) int64 {
 		switch a.(type) {
 		case int64:
 			return 1
@@ -1356,7 +1356,7 @@ func TestFunctionRegistration(t *testing.T) {
 		}
 		return ret
 	}
-	variadicGeneric := func(a ...interface{}) int64 {
+	variadicGeneric := func(a ...any) int64 {
 		return int64(len(a))
 	}
 
@@ -1406,7 +1406,7 @@ func TestFunctionRegistration(t *testing.T) {
 
 	ops := []struct {
 		query    string
-		expected interface{}
+		expected any
 	}{
 		{"SELECT addi8_16_32(1,2)", int32(3)},
 		{"SELECT addi64(1,2)", int64(3)},
@@ -1497,28 +1497,28 @@ func TestAggregatorRegistration(t *testing.T) {
 }
 
 type mode struct {
-        counts   map[interface{}]int
-        top      interface{}
-        topCount int
+	counts   map[any]int
+	top      any
+	topCount int
 }
 
 func newMode() *mode {
-        return &mode{
-                counts: map[interface{}]int{},
-        }
+	return &mode{
+		counts: map[any]int{},
+	}
 }
 
-func (m *mode) Step(x interface{}) {
-        m.counts[x]++
-        c := m.counts[x]
-        if c > m.topCount {
-                m.top = x
-                m.topCount = c
-        }
+func (m *mode) Step(x any) {
+	m.counts[x]++
+	c := m.counts[x]
+	if c > m.topCount {
+		m.top = x
+		m.topCount = c
+	}
 }
 
-func (m *mode) Done() interface{} {
-        return m.top
+func (m *mode) Done() any {
+	return m.top
 }
 
 func TestAggregatorRegistration_GenericReturn(t *testing.T) {
@@ -1534,19 +1534,19 @@ func TestAggregatorRegistration_GenericReturn(t *testing.T) {
 	defer db.Close()
 
 	_, err = db.Exec("create table foo (department integer, profits integer)")
-        if err != nil {
-                t.Fatal("Failed to create table:", err)
-        }
-        _, err = db.Exec("insert into foo values (1, 10), (1, 20), (1, 45), (2, 42), (2, 115), (2, 20)")
-        if err != nil {
-                t.Fatal("Failed to insert records:", err)
-        }
+	if err != nil {
+		t.Fatal("Failed to create table:", err)
+	}
+	_, err = db.Exec("insert into foo values (1, 10), (1, 20), (1, 45), (2, 42), (2, 115), (2, 20)")
+	if err != nil {
+		t.Fatal("Failed to insert records:", err)
+	}
 
 	var mode int
-        err = db.QueryRow("select mode(profits) from foo").Scan(&mode)
-        if err != nil {
-                t.Fatal("MODE query error:", err)
-        }
+	err = db.QueryRow("select mode(profits) from foo").Scan(&mode)
+	if err != nil {
+		t.Fatal("MODE query error:", err)
+	}
 
 	if mode != 20 {
 		t.Fatal("Got incorrect mode. Wanted 20, got: ", mode)
@@ -1871,7 +1871,7 @@ func TestNonColumnString(t *testing.T) {
 	}
 	defer db.Close()
 
-	var x interface{}
+	var x any
 	if err := db.QueryRow("SELECT 'hello'").Scan(&x); err != nil {
 		t.Fatal(err)
 	}
@@ -2113,7 +2113,7 @@ var benchmarks = []testing.InternalBenchmark{
 	{Name: "BenchmarkStmtRows", F: benchmarkStmtRows},
 }
 
-func (db *TestDB) mustExec(sql string, args ...interface{}) sql.Result {
+func (db *TestDB) mustExec(sql string, args ...any) sql.Result {
 	res, err := db.Exec(sql, args...)
 	if err != nil {
 		db.Fatalf("Error running %q: %v", sql, err)