DescribeToolSet returns a short description for ts suitable for user-visible messages. It walks the wrapper chain (e.g. through WithName / StartableToolSet) so any inner Describer is reachable; falls back to the Go type name when no inner toolset implements Describer.
(ts ToolSet)
| 23 | // StartableToolSet) so any inner Describer is reachable; falls back to |
| 24 | // the Go type name when no inner toolset implements Describer. |
| 25 | func DescribeToolSet(ts ToolSet) string { |
| 26 | if d, ok := As[Describer](ts); ok { |
| 27 | if desc := d.Describe(); desc != "" { |
| 28 | return desc |
| 29 | } |
| 30 | } |
| 31 | // Unwrap once for the type-name fallback so wrappers don't show up |
| 32 | // as e.g. "*tools.namedToolSet". |
| 33 | if u, ok := ts.(Unwrapper); ok { |
| 34 | ts = u.Unwrap() |
| 35 | } |
| 36 | return fmt.Sprintf("%T", ts) |
| 37 | } |
| 38 | |
| 39 | // failureStreak implements once-per-streak warning de-duplication. A streak |
| 40 | // begins on the first fail() and ends on reset() (a success or a Stop). |