dgryski.semgrep-go.oserrors.os-error-handling-functions

profile photo of dgryskidgryski
Author
581
Download Count*
License

New code should use errors.Is with the appropriate error type

Run Locally

Run in CI

Defintion

rules:
  - id: os-error-handling-functions
    patterns:
      - pattern-either:
          - pattern: os.IsExist(...)
          - pattern: os.IsNotExist(...)
          - pattern: os.IsPermission(...)
          - pattern: os.IsTimeout(...)
    message: New code should use errors.Is with the appropriate error type
    languages:
      - go
    severity: ERROR
    metadata:
      license: MIT