1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

refactor: replace interface{} with any

This commit is contained in:
Frédéric Guillot 2025-08-05 20:21:28 -07:00
parent 045f2f1747
commit 80f48c88c7
12 changed files with 26 additions and 26 deletions

View file

@ -15,7 +15,7 @@ import (
type EntryPaginationBuilder struct {
store *Storage
conditions []string
args []interface{}
args []any
entryID int64
order string
direction string
@ -170,7 +170,7 @@ func (e *EntryPaginationBuilder) getEntry(tx *sql.Tx, entryID int64) (*model.Ent
func NewEntryPaginationBuilder(store *Storage, userID, entryID int64, order, direction string) *EntryPaginationBuilder {
return &EntryPaginationBuilder{
store: store,
args: []interface{}{userID, "removed"},
args: []any{userID, "removed"},
conditions: []string{"e.user_id = $1", "e.status <> $2"},
entryID: entryID,
order: order,

View file

@ -18,7 +18,7 @@ import (
// EntryQueryBuilder builds a SQL query to fetch entries.
type EntryQueryBuilder struct {
store *Storage
args []interface{}
args []any
conditions []string
sortExpressions []string
limit int
@ -468,7 +468,7 @@ func (e *EntryQueryBuilder) buildSorting() string {
func NewEntryQueryBuilder(store *Storage, userID int64) *EntryQueryBuilder {
return &EntryQueryBuilder{
store: store,
args: []interface{}{userID},
args: []any{userID},
conditions: []string{"e.user_id = $1"},
}
}

View file

@ -16,14 +16,14 @@ import (
// FeedQueryBuilder builds a SQL query to fetch feeds.
type FeedQueryBuilder struct {
store *Storage
args []interface{}
args []any
conditions []string
sortExpressions []string
limit int
offset int
withCounters bool
counterJoinFeeds bool
counterArgs []interface{}
counterArgs []any
counterConditions []string
}
@ -31,9 +31,9 @@ type FeedQueryBuilder struct {
func NewFeedQueryBuilder(store *Storage, userID int64) *FeedQueryBuilder {
return &FeedQueryBuilder{
store: store,
args: []interface{}{userID},
args: []any{userID},
conditions: []string{"f.user_id = $1"},
counterArgs: []interface{}{userID, model.EntryStatusRead, model.EntryStatusUnread},
counterArgs: []any{userID, model.EntryStatusRead, model.EntryStatusUnread},
counterConditions: []string{"e.user_id = $1", "e.status IN ($2, $3)"},
}
}

View file

@ -70,7 +70,7 @@ func (s *Storage) UpdateAppSessionField(sessionID, field string, value any) erro
return nil
}
func (s *Storage) UpdateAppSessionObjectField(sessionID, field string, value interface{}) error {
func (s *Storage) UpdateAppSessionObjectField(sessionID, field string, value any) error {
query := `
UPDATE
sessions

View file

@ -521,7 +521,7 @@ func (s *Storage) UserByAPIKey(token string) (*model.User, error) {
return s.fetchUser(query, token)
}
func (s *Storage) fetchUser(query string, args ...interface{}) (*model.User, error) {
func (s *Storage) fetchUser(query string, args ...any) (*model.User, error) {
var user model.User
err := s.db.QueryRow(query, args...).Scan(
&user.ID,