You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use case
This would allow us to strengthen our Semgrep rules that attempt to catch branching on certain constants (using either switch or if). Our existing workaround is to use pattern-either to enumerate patterns for a fixed number of case clauses (e.g. 0-8).
The text was updated successfully, but these errors were encountered:
Describe the bug
The ellipsis operator cannot be used to match sequences of case clauses in a Go switch statement. For example, I'd expect the following:
To match the following examples:
To Reproduce
https://semgrep.dev/playground/s/BY0ob
What is the priority of the bug to you?
Use case
This would allow us to strengthen our Semgrep rules that attempt to catch branching on certain constants (using either
switch
orif
). Our existing workaround is to usepattern-either
to enumerate patterns for a fixed number of case clauses (e.g. 0-8).The text was updated successfully, but these errors were encountered: