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

@@ -63,7 +63,7 @@ func (r *MetricRepository) Query(ctx context.Context, query MetricQuery) ([]Metr
}
defer rows.Close()
var out []MetricRow
out := make([]MetricRow, 0)
for rows.Next() {
var row MetricRow
var statDate scanDate