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
Maybe there's a rule pattern that I haven't considered that would work for that second case. Or maybe it's just not supported by the framework. Any insight here would be greatly appreciated. Thank you!
The text was updated successfully, but these errors were encountered:
If it doesn't work as expected, it needs to be fixed.
But the idea is correct.
I can add tests with that pattern to the analyzer/testdata (or you can do it, contributions are welcome).
I'm looking to find instances in which we are using the
iota
feature within golang. There are two general cases that I see available:For the first case, I wrote the following rule and it works, no problem:
However, I'm having trouble writing a rule that covers the second case. I've made several attempts:
$_ $*_ = $iota
(I recall that the pattern didn't compile)$_ = $iota
(I think because the pattern is compiled as anAssignStmt
, not aValueSpec
)const ( $_ = $iota )
(This works but only if there's a single value in the list, as soon as I add more, the pattern doesn't match)const ( $_ = $iota; $*_; )
(this fails thematchNodeList
check)Maybe there's a rule pattern that I haven't considered that would work for that second case. Or maybe it's just not supported by the framework. Any insight here would be greatly appreciated. Thank you!
The text was updated successfully, but these errors were encountered: