fix: return empty arrays for query APIs

This commit is contained in:
lingniu
2026-07-02 01:16:48 +08:00
parent 2c224396c9
commit 4711287655
4 changed files with 72 additions and 4 deletions

View File

@@ -169,7 +169,7 @@ func (r *RawFrameRepository) Query(ctx context.Context, query RawFrameQuery) ([]
}
defer rows.Close()
var out []RawFrameRow
out := make([]RawFrameRow, 0)
for rows.Next() {
var row RawFrameRow
var ts scanDateTime
@@ -222,7 +222,7 @@ func (r *LocationRepository) Query(ctx context.Context, query LocationQuery) ([]
}
defer rows.Close()
var out []LocationRow
out := make([]LocationRow, 0)
for rows.Next() {
var row LocationRow
var ts scanDateTime
@@ -282,7 +282,7 @@ func (r *MileagePointRepository) Query(ctx context.Context, query MileagePointQu
}
defer rows.Close()
var out []MileagePointRow
out := make([]MileagePointRow, 0)
for rows.Next() {
var row MileagePointRow
var ts scanDateTime