errcheck

errcheck is a program for checking for unchecked errors in go programs.

Version

23699b7e2cbfdb89481023524954ba2aeff6be90

Runtime

Go Versions

Supported Languages

Go

Official Documentation

https://github.com/kisielk/errcheck

YAML Configuration

errcheck:

  • input:

    Patterns to include in execution and reports.

    Note: Inspecode runs errcheck for each Go package and the input patterns are used for selecting Go packages containing input files. Therefore, the files excluded by the patterns are processed if they are contained in Go packages that also contain input files, and you may even see logs related to the excluded files in the job console. However, Inspecode eventually ignores any issues detected on the excluded files when generating job reports.

  • ignore:

    Patterns to exclude from execution and reports.

    Note: Just like input:, the ignore patterns may not be applied completely when running errcheck.

  • options:

    Below is the list of options that are supported:

    -asserts
            if true, check for ignored type assertion results
    -blank
            if true, check for errors assigned to blank identifier
    -exclude string
            Path to a file containing a list of functions to exclude from checking
    -ignore value
            [deprecated] comma-separated list of pairs of the form pkg:regex
              the regex is used to ignore names within pkg. (default "fmt:.*")
    -ignorepkg string
            comma-separated list of package paths to ignore
    -ignoretests
            if true, checking of _test.go files is disabled
    -tags value
            space-separated list of build tags to include
  • experimental:

    • incremental:

      N/A

      Note: The incremental analysis cannot be supported for errcheck. This is because errcheck requires a set of buildable files or packages to work and the results on unchanged files can be affected by changed files.

YAML Examples

  • With default options:

    inspecode:
      errcheck: default
  • With custom machine:

    inspecode:
      errcheck:
        machine:
          cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
  • With custom options:

    inspecode:
      errcheck:
        options: [-asserts, -blank]

Resolving Dependencies

errcheck requires all the dependencies to build, so Inspecode resolves the dependencies in the same manner as go test. See the go test page for the details.

results matching ""

    No results matching ""