docs: trim code comments to the why (#676)

Comments that restated names or narrated the code are gone, and multi-line ones are cut to a line of why.
Only comments change: each edited Go file has the same token stream as before. winapi and abe come later.
This commit is contained in:
Roger authored and GitHub committed 2026-11-02 00:03:03 +08:00
1 parent 4e98ba7884
commit 0ed920f846
130 files changed
+201 -869

No files matched your search

+2 -8
View File
@@ -11,14 +11,8 @@ import (
"github.com/moond4rk/hackbrowserdata/internal/log"
)
// eachRow opens a SQLite database, optionally disables journal mode (required
// for Firefox databases), runs the query, and calls scanFn for each row.
//
// It validates the database file exists before opening to prevent sql.Open from
// silently creating an empty database.
//
// scanFn should return nil to continue iteration, or an error to skip the current
// row (the error is logged at debug level and iteration continues).
// journalOff is for Firefox databases; the file is checked first so sql.Open never creates an empty one.
// A row whose scanFn returns an error is skipped and logged at debug level.
func eachRow(dbPath string, journalOff bool, query string, scanFn func(*sql.Rows) error) error {
if _, err := os.Stat(dbPath); err != nil {
return fmt.Errorf("database file: %w", err)