Fix SwitchBuilder.AddCase godoc: no type-T filtering - #1149
PratikDhanave (PratikDhanave) wants to merge 1 commit into
Conversation
AddCase takes predicate func(msg any) bool with no type parameter; the predicate alone matches the raw message. The doc's "messages of type T" implied a generic type filter that does not exist.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The documentation now accurately matches the existing API and behavior.
Review effort: Lite
Findings: None
What changed in this PR
Clarifies SwitchBuilder.AddCase documentation to accurately describe predicate-based matching.
Changes:
- Removes the incorrect generic type-filter implication from the
AddCasegodoc.
| File | Description |
|---|---|
workflow/builder.go |
Corrects AddCase documentation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Scope: internal-only (documentation/comment fix)
|
The comment says AddCase matches "messages of type T satisfying the predicate," implying a generic type filter. The signature is
AddCase(predicate func(msg any) bool, targets ...ExecutorBinding)— there is no type parameter; the predicate receives the rawanymessage and is the sole matcher. Comment-only fix.