From 7c1602c2c08bdc3f907fc0b849d996783b911cda Mon Sep 17 00:00:00 2001 From: gudvinr Date: Fri, 15 Aug 2025 19:39:03 +0300 Subject: [PATCH] refactor(internal): fix doc comments --- internal/model/webauthn.go | 2 +- internal/storage/category.go | 4 ++-- internal/storage/entry.go | 4 +--- internal/storage/feed.go | 2 +- internal/storage/webauthn.go | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/internal/model/webauthn.go b/internal/model/webauthn.go index 8bda49f5..1872b316 100644 --- a/internal/model/webauthn.go +++ b/internal/model/webauthn.go @@ -14,7 +14,7 @@ import ( "github.com/go-webauthn/webauthn/webauthn" ) -// handle marshalling / unmarshalling session data +// WebAuthnSession handles marshalling / unmarshalling session data type WebAuthnSession struct { *webauthn.SessionData } diff --git a/internal/storage/category.go b/internal/storage/category.go index 8035c374..54253fec 100644 --- a/internal/storage/category.go +++ b/internal/storage/category.go @@ -236,8 +236,8 @@ func (s *Storage) RemoveCategory(userID, categoryID int64) error { return nil } -// delete the given categories, replacing those categories with the user's first -// category on affected feeds +// RemoveAndReplaceCategoriesByName deletes the given categories, replacing those categories with the user's first +// category on affected feeds. func (s *Storage) RemoveAndReplaceCategoriesByName(userid int64, titles []string) error { tx, err := s.db.Begin() if err != nil { diff --git a/internal/storage/entry.go b/internal/storage/entry.go index dfad844a..9edc94c5 100644 --- a/internal/storage/entry.go +++ b/internal/storage/entry.go @@ -155,7 +155,6 @@ func (s *Storage) createEntry(tx *sql.Tx, entry *model.Entry) error { &entry.CreatedAt, &entry.ChangedAt, ) - if err != nil { return fmt.Errorf(`store: unable to create entry %q (feed #%d): %v`, entry.URL, entry.FeedID, err) } @@ -208,7 +207,6 @@ func (s *Storage) updateEntry(tx *sql.Tx, entry *model.Entry) error { entry.Hash, pq.Array(entry.Tags), ).Scan(&entry.ID) - if err != nil { return fmt.Errorf(`store: unable to update entry %q: %v`, entry.URL, err) } @@ -421,7 +419,7 @@ func (s *Storage) SetEntriesStatusCount(userID int64, entryIDs []int64, status s return visible, nil } -// SetEntriesBookmarked update the bookmarked state for the given list of entries. +// SetEntriesBookmarkedState updates the bookmarked state for the given list of entries. func (s *Storage) SetEntriesBookmarkedState(userID int64, entryIDs []int64, starred bool) error { query := `UPDATE entries SET starred=$1, changed_at=now() WHERE user_id=$2 AND id=ANY($3)` result, err := s.db.Exec(query, starred, userID, pq.Array(entryIDs)) diff --git a/internal/storage/feed.go b/internal/storage/feed.go index 06c801d4..0e703a3e 100644 --- a/internal/storage/feed.go +++ b/internal/storage/feed.go @@ -157,7 +157,7 @@ func (s *Storage) FeedsWithCounters(userID int64) (model.Feeds, error) { return getFeedsSorted(builder) } -// Return read and unread count. +// FetchCounters returns read and unread count. func (s *Storage) FetchCounters(userID int64) (model.FeedCounters, error) { builder := NewFeedQueryBuilder(s, userID) builder.WithCounters() diff --git a/internal/storage/webauthn.go b/internal/storage/webauthn.go index 80f51a2d..4a24823e 100644 --- a/internal/storage/webauthn.go +++ b/internal/storage/webauthn.go @@ -12,7 +12,7 @@ import ( "miniflux.app/v2/internal/model" ) -// handle storage of webauthn credentials +// AddWebAuthnCredential handles storage of webauthn credentials. func (s *Storage) AddWebAuthnCredential(userID int64, handle []byte, credential *webauthn.Credential) error { query := ` INSERT INTO webauthn_credentials