func fetchCardIDs(ctx context.Context, db *cql.DB) ([]string, error) { ids := []string{} rows, err := db.QueryC(ctx, "SELECT id FROM cards") if err != nil { return ids, err } defer rows.Close() for rows.Next() { var id string if err := rows.Scan(&id); err != nil { return ids, err } ids = append(ids, id) } return ids, rows.Err() }