mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
fix: reconcile the issues stream and remove the legacy output shims
Use one canPrompt and pullNumberArguments for the comment commands, set display preferences instead of the retired environment variables in tests, and delete writeList, writeItem, batch, table, writeRecord(s), the legacy column map, confirm, require, validateMilestoneFlags and listWindow now that every command uses their replacements. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
13 files changed
+23
-172
No files matched your search
@@ -64,13 +64,6 @@ type Page[T any] struct {
|
||||
Counted bool
|
||||
}
|
||||
|
||||
// listWindow returns items [(page-1)*limit, page*limit) even when the server caps its page size
|
||||
// below limit (MAX_RESPONSE_ITEMS), and reports whether the collection continues past them.
|
||||
func listWindow[T any](limit, page int, fetch func(limit, page int) ([]T, http.Header, error)) ([]T, bool, error) {
|
||||
window, err := listPage(limit, page, fetch)
|
||||
return window.Items, window.More, err
|
||||
}
|
||||
|
||||
// listPage is listWindow that also reports the collection size the server counted.
|
||||
func listPage[T any](limit, page int, fetch func(limit, page int) ([]T, http.Header, error)) (Page[T], error) {
|
||||
items, headers, err := fetch(limit, page)
|
||||
|
||||
Reference in new issue
Block a user