dkorunic / semgrep-go

Go rules for semgrep

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

semgrep-go

About

This repo is holding Semgrep patterns for finding possibly problematic code.

To run individual semgrep rule on the current Go project:

semgrep -f rule.yml .

To run all included semgrep rules on the current Go project:

semgrep -f path/to/semgrep-go/ .

To make Semgrep skip over some files (ie. go-swagger or some other auto-generated files), use either .semgrepignore or .gitignore.

Contents

  • json-without-jsoniter: check for stdlib json Marshal() or Unmarshal() use without jsoniter
  • err-overwrite.yml: check if err is being overwritten in Go routines without shadow declarations

About

Go rules for semgrep

License:MIT License