chore: fix golang checks

This commit is contained in:
Johnny 2025-12-16 22:53:36 +08:00
parent 40e129b8af
commit 310590b278
3 changed files with 6 additions and 6 deletions

View File

@ -68,10 +68,10 @@ func (d *DB) GetUserSessionByID(ctx context.Context, sessionID string) (*store.U
WHERE ` + "`key`" + ` = 'SESSIONS' WHERE ` + "`key`" + ` = 'SESSIONS'
AND JSON_SEARCH(value, 'one', ?, NULL, '$.sessions[*].sessionId') IS NOT NULL AND JSON_SEARCH(value, 'one', ?, NULL, '$.sessions[*].sessionId') IS NOT NULL
` `
var userID int32 var userID int32
var sessionsJSON string var sessionsJSON string
err := d.db.QueryRowContext(ctx, query, sessionID).Scan(&userID, &sessionsJSON) err := d.db.QueryRowContext(ctx, query, sessionID).Scan(&userID, &sessionsJSON)
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -85,10 +85,10 @@ func (d *DB) GetUserSessionByID(ctx context.Context, sessionID string) (*store.U
WHERE session->>'sessionId' = $1 WHERE session->>'sessionId' = $1
) )
` `
var userID int32 var userID int32
var sessionsJSON string var sessionsJSON string
err := d.db.QueryRowContext(ctx, query, sessionID).Scan(&userID, &sessionsJSON) err := d.db.QueryRowContext(ctx, query, sessionID).Scan(&userID, &sessionsJSON)
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -84,10 +84,10 @@ func (d *DB) GetUserSessionByID(ctx context.Context, sessionID string) (*store.U
WHERE json_extract(session.value, '$.sessionId') = ? WHERE json_extract(session.value, '$.sessionId') = ?
) )
` `
var userID int32 var userID int32
var sessionsJSON string var sessionsJSON string
err := d.db.QueryRowContext(ctx, query, sessionID).Scan(&userID, &sessionsJSON) err := d.db.QueryRowContext(ctx, query, sessionID).Scan(&userID, &sessionsJSON)
if err != nil { if err != nil {
return nil, err return nil, err