From d8880e4ceeb2792b7aa7291c2ed482a23754c653 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Wed, 13 Aug 2025 03:31:12 +0100 Subject: [PATCH] Fixes. --- driver/driver.go | 2 +- ext/fileio/fileio.go | 2 +- ext/unicode/unicode.go | 2 +- func.go | 2 +- tests/bradfitz/sql_test.go | 2 +- util/ioutil/seek.go | 2 +- util/osutil/osfs.go | 2 +- value.go | 6 +++--- vfs/filename.go | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/driver/driver.go b/driver/driver.go index 280611f..992aa49 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -740,7 +740,7 @@ func (r *rows) ColumnTypeScanType(index int) (typ reflect.Type) { switch { case scan == _TIME && val != _BLOB && val != _NULL: t := r.Stmt.ColumnTime(index, r.tmRead) - useValType = t == time.Time{} + useValType = t.IsZero() case scan == _BOOL && val == _INT: i := r.Stmt.ColumnInt64(index) useValType = i != 0 && i != 1 diff --git a/ext/fileio/fileio.go b/ext/fileio/fileio.go index 5b2a67c..885f1c4 100644 --- a/ext/fileio/fileio.go +++ b/ext/fileio/fileio.go @@ -18,7 +18,7 @@ func Register(db *sqlite3.Conn) error { return RegisterFS(db, nil) } -// Register registers SQL functions readfile, lsmode, +// RegisterFS registers SQL functions readfile, lsmode, // and the table-valued function fsdir; // fsys will be used to read files and list directories. func RegisterFS(db *sqlite3.Conn, fsys fs.FS) error { diff --git a/ext/unicode/unicode.go b/ext/unicode/unicode.go index 6abe62e..de16845 100644 --- a/ext/unicode/unicode.go +++ b/ext/unicode/unicode.go @@ -43,7 +43,7 @@ import ( "github.com/ncruces/go-sqlite3/internal/util" ) -// Set RegisterLike to false to not register a Unicode aware LIKE operator. +// RegisterLike must be set to false to not register a Unicode aware LIKE operator. // Overriding the built-in LIKE operator disables the [LIKE optimization]. // // [LIKE optimization]: https://sqlite.org/optoverview.html#the_like_optimization diff --git a/func.go b/func.go index 1cd384b..556d89e 100644 --- a/func.go +++ b/func.go @@ -59,7 +59,7 @@ func (c *Conn) CreateCollation(name string, fn CollatingFunction) error { return c.error(rc) } -// Collating function is the type of a collation callback. +// CollatingFunction is the type of a collation callback. // Implementations must not retain a or b. type CollatingFunction func(a, b []byte) int diff --git a/tests/bradfitz/sql_test.go b/tests/bradfitz/sql_test.go index fca9372..c65b34b 100644 --- a/tests/bradfitz/sql_test.go +++ b/tests/bradfitz/sql_test.go @@ -35,7 +35,7 @@ type params struct { *sql.DB } -func (t params) mustExec(sql string, args ...interface{}) sql.Result { +func (t params) mustExec(sql string, args ...any) sql.Result { res, err := t.DB.Exec(sql, args...) if err != nil { t.Fatalf("Error running %q: %v", sql, err) diff --git a/util/ioutil/seek.go b/util/ioutil/seek.go index 0e0e124..999bf17 100644 --- a/util/ioutil/seek.go +++ b/util/ioutil/seek.go @@ -49,7 +49,7 @@ func (s *SeekingReaderAt) Size() (int64, error) { return s.r.Seek(0, io.SeekEnd) } -// ReadAt implements [io.Closer]. +// Close implements [io.Closer]. func (s *SeekingReaderAt) Close() error { s.l.Lock() defer s.l.Unlock() diff --git a/util/osutil/osfs.go b/util/osutil/osfs.go index 52653d7..a9659f2 100644 --- a/util/osutil/osfs.go +++ b/util/osutil/osfs.go @@ -23,7 +23,7 @@ func (FS) Open(name string) (fs.File, error) { return os.OpenFile(name, os.O_RDONLY, 0) } -// ReadFileFS implements [fs.StatFS]. +// Stat implements [fs.StatFS]. func (FS) Stat(name string) (fs.FileInfo, error) { return os.Stat(name) } diff --git a/value.go b/value.go index 54d8f21..6806e9a 100644 --- a/value.go +++ b/value.go @@ -31,9 +31,9 @@ func (v Value) Dup() *Value { // Close frees an SQL value previously obtained by [Value.Dup]. // // https://sqlite.org/c3ref/value_dup.html -func (dup *Value) Close() error { - dup.c.call("sqlite3_value_free", stk_t(dup.handle)) - dup.handle = 0 +func (v *Value) Close() error { + v.c.call("sqlite3_value_free", stk_t(v.handle)) + v.handle = 0 return nil } diff --git a/vfs/filename.go b/vfs/filename.go index 965c3b1..be16b3d 100644 --- a/vfs/filename.go +++ b/vfs/filename.go @@ -56,7 +56,7 @@ func (n *Filename) Journal() string { return n.path("sqlite3_filename_journal") } -// Journal returns the name of the corresponding WAL file. +// WAL returns the name of the corresponding WAL file. // // https://sqlite.org/c3ref/filename_database.html func (n *Filename) WAL() string {