dgryski.semgrep-go.anon-struct-args.anonymous-struct-args

profile photo of dgryskidgryski
Author
581
Download Count*
License

Odd use of anonymous structs for function arguments

Run Locally

Run in CI

Defintion

rules:
  - id: anonymous-struct-args
    patterns:
      - pattern-either:
          - pattern: func $FUNC(..., $NAME *struct { ... }, ...)
          - pattern: func $FUNC(..., $NAME struct { ... }, ...)
          - pattern: func ($T $TYPE) $FUNC(..., $NAME *struct { ... }, ...)
          - pattern: func ($T $TYPE) $FUNC(..., $NAME struct { ... }, ...)
    message: Odd use of anonymous structs for function arguments
    languages:
      - go
    severity: ERROR
    metadata:
      license: MIT