dgryski.semgrep-go.writestring.use-fprintf-not-write-fsprint

profile photo of dgryskidgryski
Author
unknown
Download Count*
License

use fmt.Fprintf($W, $...VALS) instead of fmt.Sprintf and []byte conversion

Run Locally

Run in CI

Defintion

rules:
  - id: use-fprintf-not-write-fsprint
    patterns:
      - pattern: $W.Write([]byte(fmt.Sprintf($...VALS)))
    message: use fmt.Fprintf($W, $...VALS) instead of fmt.Sprintf and []byte conversion
    languages:
      - go
    severity: ERROR
    metadata:
      license: MIT