small refactor and update next-release readme

This commit is contained in:
yusing
2025-01-02 12:20:21 +08:00
parent a587ada170
commit 9f71fc2dd5
4 changed files with 152 additions and 105 deletions

View File

@@ -1,6 +1,9 @@
package task
import "strings"
import (
"slices"
"strings"
)
// debug only.
func (t *Task) listChildren() []string {
@@ -24,3 +27,17 @@ func (t *Task) listCallbacks() []string {
}
return callbacks
}
// DebugTaskList returns list of all tasks.
//
// The returned string is suitable for printing to the console.
func DebugTaskList() []string {
l := make([]string, 0, allTasks.Size())
allTasks.RangeAll(func(t *Task) {
l = append(l, t.name)
})
slices.Sort(l)
return l
}