tools/semgrep-rules/semgrep-go/README.md
Encore Note
We've copied in the rules from https://github.com/dgryski/semgrep-go on 2023-07-27 However delete some rules that we don't want to run in our codebase and updated some other rules.
This repo holds patterns for finding odd Go code.
The rules engines currently supported:
I'll accept comby patterns if you can't get them to work with either semgrep or ruleguard.
To run a single semgrep rule:
$ semgrep -f path/to/semgrep-go/rule.yml .
To run all semgrep rules:
$ semgrep -f path/to/semgrep-go/ .
To run all the ruleguard rules:
$ ruleguard -c=0 -rules path/to/semgrep-go/ruleguard.rules.go ./...
Semgrep checks:
2^x and 10^x which look like exponentiationRuleguard checks are in ruleguard.rules.go.
err which are not the error typex = y ; y = x pairs.2^x and 10^x , which look like exponentiationFind this useful? Buy me a coffee!