gosimple deprecated

gosimple is a linter for Go source code that specialises on simplifying code.




Go Versions

Supported Languages


Official Documentation


YAML Configuration


  • input:

    Patterns to include in execution and reports.

    Note: Inspecode runs gosimple 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 gosimple.

  • auto-fix:


    Note: As of now, gosimple does not keep CRLF line endings and all EOL characters are converted to LF in files where the auto-fix is applied. We will solve this problem, but for the time being, please don't enable the auto-fix feature if you need to keep CRLF line endings.

  • config-file:


  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.75 CPU with 2880 MiB RAM.

  • options:

    Below is the list of options that are supported:

            Check generated code
    -go version
            Target Go version in the format '1.x' (default 1.12)
    -ignore string
            Space separated list of checks to ignore, in the following format: 'import/path/file.go:Check1,Check2,...' Both the import path and file name sections support globbing, e.g. 'os/exec/*_test.go'
            Don't filter ignored problems
    -tags build tags
            List of build tags
            Include tests (default true)
  • thresholds:

    • num-issues:

      No tool specific severity levels are available.

  • experimental:

    • incremental:


      Note: The incremental analysis cannot be supported for gosimple. This is because gosimple 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:

      gosimple: default
  • With enabling auto-fixing and default options:

      gosimple: auto-fix
  • With custom machine:

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

            - github.com/*/*/pkg1:S1000
            - github.com/*/*/pkg2:S1005
            - github.com/*/*/pkg3:*

Resolving Dependencies

gosimple 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 ""