Skip to content

Fix SwitchBuilder.AddCase godoc: no type-T filtering - #1149

Open
PratikDhanave (PratikDhanave) wants to merge 1 commit into
microsoft:mainfrom
PratikDhanaveFork:fix/godoc-switch-addcase
Open

PratikDhanave (PratikDhanave) wants to merge 1 commit into
microsoft:mainfrom
PratikDhanaveFork:fix/godoc-switch-addcase

Conversation

@PratikDhanave

Copy link
Copy Markdown
Contributor

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 raw any message and is the sole matcher. Comment-only fix.

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.
Copilot AI lite review requested due to automatic review settings September 22, 2026 03:13
@github-actions github-actions Bot added area:workflow Changes files in the workflow area size:small At most 30 changed lines across at most 2 files labels Sep 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AddCase godoc.
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.

@github-actions

Copy link
Copy Markdown
Contributor

Scope: internal-only (documentation/comment fix)
Changed Go contract: None — SwitchBuilder.AddCase signature, defaults, and behavior are unchanged. The only change is a godoc comment correction in workflow/builder.go (removing an inaccurate "type T filtering" claim; the predicate already only ever received func(msg any) bool).
Upstream evidence reviewed: Not applicable — no exported API or observable behavior changed, so no upstream .NET/Python comparison is needed.
Result: out of scope

Generated by Go API Consistency Review Agent · copilot · auto · 12.4 AIC · ⌖ 6.72 AIC · ⊞ 9.2K ·

@github-actions github-actions Bot added the kind:docs Changes documentation or comments label Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workflow Changes files in the workflow area kind:docs Changes documentation or comments size:small At most 30 changed lines across at most 2 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants