---
title: Migration guide
---

## Command `migrate`

You can use golangci-lint to migrate your configuration with the `migrate` command:

```bash
golangci-lint migrate
```

Be aware that **comments inside a configuration file are not migrated.** You need to add them manually after the migration.

**Deprecated options from v1 or unknown fields are not migrated.**

The migration file format is based on the extension of the [configuration file](/usage/configuration/#config-file).
The format can be overridden by using the `--format` flag:

```bash
golangci-lint migrate --format json
```

Before the migration, the previous configuration file is copied and saved to a file named `<config_file_name>.bck.<config_file_extension>`.

By default, before the migration process, the configuration file is validated against the JSON Schema of configuration v1.
If you want to skip this validation, you can use the `--skip-validation` flag:

```bash
golangci-lint migrate --skip-validation
```

The `migrate` command enforces the following default values:

- `run.timeout`: the existing value is ignored because, in v2, there is no timeout by default.
- `issues.show-stats`: the existing value is ignored because, in v2, stats are enabled by default.
- `run.concurrency`: if the existing value was `0`, it is removed as `0` is the new default.
- `run.relative-path-mode`: if the existing value was `cfg`, it is removed as `cfg` is the new default.

`issues.exclude-generated` has a new default value (v1 `lax`, v2 `strict`), so this field will be added during the migration to maintain the previous behavior.

`issues.exclude-dirs-use-default` has been removed, so it is converted to `linters.exclusions.paths` and, if needed, `formatters.exclusions.paths`.

Other fields explicitly defined in the configuration file are migrated even if the value is the same as the default value.

The `migrate` command automatically migrates `linters.presets` in individual linters to `linters.enable`.

```txt
Migrate configuration file from v1 to v2

Usage:
  golangci-lint migrate [flags]

Flags:
  -c, --config PATH       Read config from file path PATH
      --no-config         Don't read config file
      --format string     Output file format.
                          By default, the format of the input configuration file is used.
                          It can be 'yml', 'yaml', 'toml', or 'json'.
      --skip-validation   Skip validation of the configuration file against the JSON Schema for v1.

Global Flags:
  -h, --help           Help for a command

```

## Changes

### `linters`

#### `linters.disable-all`

This property has been replaced with `linters.default: none`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters:
  disable-all: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  default: none
```

</details>

#### `linters.enable-all`

This property has been replaced with `linters.default: all`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters:
  enable-all: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  default: all
```

</details>

#### `linters.enable[].<formatter_name>`

The linters `gci`, `gofmt`, `gofumpt`, and `goimports` have been moved to the `formatters` section.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters:
  enable:
    - gci
    - gofmt
    - gofumpt
    - goimports
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
formatters:
  enable:
    - gci
    - gofmt
    - gofumpt
    - goimports
```

</details>

#### `linters.enable[].{stylecheck,gosimple,staticcheck}`

The linters `stylecheck`, `gosimple`, and `staticcheck` has been merged inside the `staticcheck`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters:
  enable:
    - gosimple
    - staticcheck
    - stylecheck
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  enable:
    - staticcheck
```

</details>

#### `linters.fast`

This property has been removed.

There are 2 new options (they are not strictly equivalent to the previous option):

1. `linters.default: fast`: set all "fast" linters as the default set of linters.
    ```yaml
    linters:
      default: fast
    ```
2. `--fast-only`: filters all enabled linters to keep only "fast" linters.

#### `linters.presets`

This property has been removed.

The `migrate` command automatically migrates `linters.presets` in individual linters to `linters.enable`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

Presets:

- bugs:
  - `asasalint`
  - `asciicheck`
  - `bidichk`
  - `bodyclose`
  - `contextcheck`
  - `durationcheck`
  - `errcheck`
  - `errchkjson`
  - `errorlint`
  - `exhaustive`
  - `gocheckcompilerdirectives`
  - `gochecksumtype`
  - `gosec`
  - `gosmopolitan`
  - `govet`
  - `loggercheck`
  - `makezero`
  - `musttag`
  - `nilerr`
  - `nilnesserr`
  - `noctx`
  - `protogetter`
  - `reassign`
  - `recvcheck`
  - `rowserrcheck`
  - `spancheck`
  - `sqlclosecheck`
  - `staticcheck`
  - `testifylint`
  - `zerologlint`
- comment:
  - `dupword`
  - `godot`
  - `godox`
  - `misspell`
- complexity:
  - `cyclop`
  - `funlen`
  - `gocognit`
  - `gocyclo`
  - `maintidx`
  - `nestif`
- error:
  - `err113`
  - `errcheck`
  - `errorlint`
  - `wrapcheck`
- format:
  - `gci`
  - `gofmt`
  - `gofumpt`
  - `goimports`
- import:
  - `depguard`
  - `gci`
  - `goimports`
  - `gomodguard`
- metalinter:
  - `gocritic`
  - `govet`
  - `revive`
  - `staticcheck`
- module:
  - `depguard`
  - `gomoddirectives`
  - `gomodguard`
- performance:
  - `bodyclose`
  - `fatcontext`
  - `noctx`
  - `perfsprint`
  - `prealloc`
- sql:
  - `rowserrcheck`
  - `sqlclosecheck`
- style:
  - `asciicheck`
  - `canonicalheader`
  - `containedctx`
  - `copyloopvar`
  - `decorder`
  - `depguard`
  - `dogsled`
  - `dupl`
  - `err113`
  - `errname`
  - `exhaustruct`
  - `exptostd`
  - `forbidigo`
  - `forcetypeassert`
  - `ginkgolinter`
  - `gochecknoglobals`
  - `gochecknoinits`
  - `goconst`
  - `gocritic`
  - `godot`
  - `godox`
  - `goheader`
  - `gomoddirectives`
  - `gomodguard`
  - `goprintffuncname`
  - `gosimple`
  - `grouper`
  - `iface`
  - `importas`
  - `inamedparam`
  - `interfacebloat`
  - `intrange`
  - `ireturn`
  - `lll`
  - `loggercheck`
  - `makezero`
  - `mirror`
  - `misspell`
  - `mnd`
  - `musttag`
  - `nakedret`
  - `nilnil`
  - `nlreturn`
  - `nolintlint`
  - `nonamedreturns`
  - `nosprintfhostport`
  - `paralleltest`
  - `predeclared`
  - `promlinter`
  - `revive`
  - `sloglint`
  - `stylecheck`
  - `tagalign`
  - `tagliatelle`
  - `testpackage`
  - `tparallel`
  - `unconvert`
  - `usestdlibvars`
  - `varnamelen`
  - `wastedassign`
  - `whitespace`
  - `wrapcheck`
  - `wsl`
- test:
  - `exhaustruct`
  - `paralleltest`
  - `testableexamples`
  - `testifylint`
  - `testpackage`
  - `thelper`
  - `tparallel`
  - `usetesting`
- unused:
  - `ineffassign`
  - `unparam`
  - `unused`

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
# Removed
```

</details>

#### `typecheck`

This `typecheck` is not a linter, so it cannot be enabled or disabled:

- [FAQ: Why do you have typecheck errors?](/welcome/faq/#why-do-you-have-typecheck-errors)
- [FAQ: Why is it not possible to skip/ignore typecheck errors?](/welcome/faq/#why-is-it-not-possible-to-skipignore-typecheck-errors)

#### Deprecated Linters

The following deprecated linters have been removed:

- `deadcode`
- `execinquery`
- `exhaustivestruct`
- `exportloopref`
- `golint`
- `ifshort`
- `interfacer`
- `maligned`
- `nosnakecase`
- `scopelint`
- `structcheck`
- `tenv`
- `varcheck`

#### Alternative Linter Names

The alternative linters has been removed.

| Alt Name v1 | Name v2       |
|-------------|---------------|
| `gas`       | `gosec`       |
| `goerr113`  | `err113`      |
| `gomnd`     | `mnd`         |
| `logrlint`  | `loggercheck` |
| `megacheck` | `staticcheck` |
| `vet`       | `govet`       |
| `vetshadow` | `govet`       |

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters:
  enable:
    - gas
    - goerr113
    - gomnd
    - logrlint
    - megacheck
    - vet
    - vetshadow
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  enable:
    - gosec
    - err113
    - mnd
    - loggercheck
    - staticcheck
    - govet
```

</details>

### `linters-settings`

The `linters-settings` section has been split into `linters.settings` and `formatters.settings`.

Settings for `gci`, `gofmt`, `gofumpt`, and `goimports` are moved to the `formatters.settings` section.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  govet:
    enable-all: true
  gofmt:
    simplify: false
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    govet:
      enable-all: true

formatters:
  settings:
    gofmt:
      simplify: false
```

</details>

#### `linters-settings.asasalint.ignore-test`

This option has been removed.

To ignore test files, use `linters.exclusions.rules`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  asasalint:
    ignore-test: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    rules:
      - path: '(.+)_test\.go'
        linters:
          - asasalint
```

</details>

#### `linters-settings.copyloopvar.ignore-alias`

This option has been deprecated since v1.58.0 and has been replaced with `linters.settings.copyloopvar.check-alias`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  copyloopvar:
    ignore-alias: false
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    copyloopvar:
      check-alias: true
```

</details>

#### `linters-settings.cyclop.skip-tests`

This option has been removed.

To ignore test files, use `linters.exclusions.rules`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  cyclop:
    skip-test: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    rules:
      - path: '(.+)_test\.go'
        linters:
          - cyclop
```

</details>

#### `linters-settings.errcheck.exclude`

This option has been deprecated since v1.42.0 and has been removed.

To exclude functions, use `linters.settings.errcheck.exclude-functions` instead.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  errcheck:
    exclude: ./errcheck_excludes.txt
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    errcheck:
      exclude-functions:
        - io.ReadFile
        - io.Copy(*bytes.Buffer)
        - io.Copy(os.Stdout)
```

</details>

#### `linters-settings.errcheck.ignore`

This option has been deprecated since v1.13.0 and has been removed.

To exclude functions, use `linters.settings.errcheck.exclude-functions` instead.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  errcheck:
    ignore: 'io:.*'
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    errcheck:
      exclude-functions:
        - 'io.ReadFile'
        - 'io.Copy(*bytes.Buffer)'
        - 'io.Copy(os.Stdout)'
```

</details>

#### `linters-settings.exhaustive.check-generated`

This option has been removed.

To analyze generated files, use `linters.exclusions.generated`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  exhaustive:
    check-generated: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    generated: disable
```

</details>

#### `linters-settings.forbidigo.forbid[].p`

This field has been replaced with `linters-settings.forbidigo.forbid[].pattern`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  forbidigo:
    forbid:
      - p: '^fmt\.Print.*$'
        msg: Do not commit print statements.
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    forbidigo:
      forbid:
        - pattern: '^fmt\.Print.*$'
          msg: Do not commit print statements.
```

</details>

#### `linters-settings.forbidigo.forbid[]<pattern>`

The `pattern` has become mandatory for the `forbid` field.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  forbidigo:
    forbid:
      - '^print(ln)?$'
      - '^spew\.(ConfigState\.)?Dump$'
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    forbidigo:
      forbid:
        - pattern: '^print(ln)?$'
        - pattern: '^spew\.(ConfigState\.)?Dump$'
```

</details>

#### `linters-settings.gci.local-prefixes`

This option has been deprecated since v1.44.0 and has been removed.

Use `linters.settings.gci.sections` instead.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  gci:
    local-prefixes: 'github.com/example/pkg'
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    gci:
      sections:
        - standard
        - default
        - prefix(github.com/example/pkg)
```

</details>

#### `linters-settings.gci.skip-generated`

This option has been removed.

To analyze generated files, use `linters.exclusions.generated`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters:
  settings:
    gci:
      skip-generated: false
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    generated: disable
```

</details>

#### `linters-settings.goconst.ignore-tests`

This option has been removed.

To ignore test files, use `linters.exclusions.rules`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  goconst:
    ignore-tests: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    rules:
      - path: '(.+)_test\.go'
        linters:
          - goconst
```

</details>

#### `linters-settings.gocritic.settings.ruleguard.rules`

The special variable `${configDir}` has been replaced with `${base-path}`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  gocritic:
    settings:
      ruleguard:
        rules: '${configDir}/ruleguard/rules-*.go'
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    gocritic:
      settings:
        ruleguard:
          rules: '${base-path}/ruleguard/rules-*.go'
```

</details>

#### `linters-settings.govet.check-shadowing`

This option has been deprecated since v1.57.0 and has been removed.

Use `linters.settings.govet.enable: shadow` instead.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  govet:
    check-shadowing: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    govet:
      enable:
        - shadow
```

</details>

#### `linters-settings.misspell.ignore-words`

This option has been replaced with `linters.settings.misspell.ignore-rules`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  misspell:
    ignore-words:
      - foo
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    misspell:
      ignore-rules:
        - foo
```

</details>

#### `linters-settings.predeclared.ignore`

This string option has been replaced with the slice option with the same name.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  predeclared:
    ignore: "new,int"
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    predeclared:
      ignore:
        - new
        - int
```

</details>

#### `linters-settings.predeclared.q`

This option has been replaced with `linters.settings.predeclared.qualified-name`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  predeclared:
    q: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    predeclared:
      qualified-name: true
```

</details>

#### `linters-settings.revive.ignore-generated-header`

This option has been removed.

Use `linters.exclusions.generated` instead.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  revive:
    ignore-generated-header: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    generated: strict
```

</details>

#### `linters-settings.sloglint.context-only`

This option has been deprecated since v1.58.0 and has been replaced with `linters.settings.sloglint.context`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  sloglint:
    context-only: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    sloglint:
      context: all
```

</details>

#### `linters-settings.staticcheck.go`

This option has been deprecated since v1.47.0 and has been removed.

Use `run.go` instead.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  staticcheck:
    go: '1.22'
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
run:
  go: '1.22'
```

</details>

#### `linters-settings.unused.exported-is-used`

This option has been deprecated since v1.60.0 and has been removed.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  unused:
    exported-is-used: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
# Removed
```

</details>

#### `linters-settings.usestdlibvars.os-dev-null`

This option has been deprecated since v1.51.0 and has been removed.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  usestdlibvars:
    os-dev-null: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
# Removed
```

</details>

#### `linters-settings.usestdlibvars.syslog-priority`

This option has been deprecated since v1.51.0 and has been removed.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  usestdlibvars:
    syslog-priority: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
# Removed
```

</details>

#### `linters-settings.wrapcheck.ignoreInterfaceRegexps`

This option has been renamed to `linters.settings.wrapcheck.ignore-interface-regexps`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  wrapcheck:
    ignoreInterfaceRegexps:
      - '^(?i)c(?-i)ach(ing|e)'
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    wrapcheck:
      ignore-interface-regexps:
        - '^(?i)c(?-i)ach(ing|e)'
```

</details>

#### `linters-settings.wrapcheck.ignorePackageGlobs`

This option has been renamed to `linters.settings.wrapcheck.ignore-package-globs`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  wrapcheck:
    ignorePackageGlobs:
      - 'encoding/*'
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    wrapcheck:
      ignore-package-globs:
        - 'encoding/*'
```

</details>

#### `linters-settings.wrapcheck.ignoreSigRegexps`

This option has been renamed to `linters.settings.wrapcheck.ignore-sig-regexps`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
  linters-settings:
    wrapcheck:
      ignoreSigRegexps:
        - '\.New.*Error\('
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    wrapcheck:
      ignore-sig-regexps:
        - '\.New.*Error\('
```

</details>

#### `linters-settings.wrapcheck.ignoreSigs`

This option has been renamed to `linters.settings.wrapcheck.ignore-sigs`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters-settings:
  wrapcheck:
    ignoreSigs:
      - '.Errorf('
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  settings:
    wrapcheck:
      ignore-sigs:
        - '.Errorf('
```

</details>

### `issues`

#### `issues.exclude-case-sensitive`

This property has been removed.

`issues.exclude`, `issues.exclude-rules.text`, and `issues.exclude-rules.source` are case-sensitive by default.

To ignore case, use `(?i)` at the beginning of a regex syntax.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
issues:
  exclude-case-sensitive: false
  exclude:
    - 'abcdef'
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    rules:
      - path: '(.+)\.go$'
        text: (?i)abcdef
```

</details>

#### `issues.exclude-dirs-use-default`

This property has been removed.

Use `linters.exclusions.paths` and `formatters.exclusions.paths` to exclude directories.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
issues:
  exclude-dirs-use-default: true
```

</details>

<details>
  <summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    paths:
      - third_party$
      - builtin$
      - examples$
```

</details>

#### `issues.exclude-dirs`

This property has been replaced with `linters.exclusions.paths` and `formatters.exclusions.paths`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
issues:
  exclude-dirs:
    - src/external_libs
    - autogenerated_by_my_lib
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    paths:
      - src/external_libs
      - autogenerated_by_my_lib
```

</details>

#### `issues.exclude-files`

This property has been replaced with `linters.exclusions.paths` and `formatters.exclusions.paths`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
issues:
  exclude-files:
    - '.*\.my\.go$'
    - lib/bad.go
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    paths:
      - '.*\.my\.go$'
      - lib/bad.go
```

</details>

#### `issues.exclude-generated-strict`

This property has been deprecated since v1.59.0 and has been replaced with `linters.exclusions.generated: strict`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters:
  exclude-generated-strict: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    generated: strict
```

</details>

#### `issues.exclude-generated`

This property has been replaced with `linters.exclusions.generated`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
linters:
  exclude-generated: lax
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    generated: lax
```

</details>

#### `issues.exclude-rules`

This property has been replaced with `linters.exclusions.rules`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
issues:
  exclude-rules:
    - path: '_test\.go'
      linters:
        - gocyclo
        - errcheck
        - dupl
        - gosec
    - path-except: '_test\.go'
      linters:
        - staticcheck
    - path: internal/hmac/
      text: "weak cryptographic primitive"
      linters:
        - gosec
    - linters:
        - staticcheck
      text: "SA9003:"
    - linters:
        - err113
      source: "foo"
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    rules:
      - path: '_test\.go'
        linters:
          - dupl
          - errcheck
          - gocyclo
          - gosec
      - path-except: '_test\.go'
        linters:
          - staticcheck
      - path: internal/hmac/
        text: weak cryptographic primitive
        linters:
          - gosec
      - text: 'SA9003:'
        linters:
          - staticcheck
      - source: foo
        linters:
          - err113
  ```

</details>


#### `issues.exclude-use-default`

This property has been replaced with `linters.exclusions.presets`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
issues:
  exclude-use-default: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    presets:
      - comments
      - common-false-positives
      - legacy
      - std-error-handling
```

</details>

#### `issues.exclude`

This property has been replaced with `linters.exclusions.rules`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
issues:
  exclude:
    - abcdef
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
  rules:
    - path: '(.+)\.go$'
      text: abcdef
```

</details>

#### `issues.include`

This property has been replaced with `linters.exclusions.presets`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
issues:
  include:
    - EXC0014
    - EXC0015
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    presets:
      - common-false-positives
      - legacy
      - std-error-handling
```

</details>

### `output`

#### `output.format`

This property has been deprecated since v1.57.0 and has been replaced with `output.formats`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
output:
  format: 'checkstyle:report.xml,json:stdout,colored-line-number'
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
output:
  formats:
    checkstyle:
      path: 'report.xml'
    json:
      path: stdout
    text:
      path: stdout
      color: true
```

</details>

#### `output.formats[].format: <name>`

The property `output.formats[].format` has been replaced with `output.formats[].<format_name>`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
output:
  formats:
    - format: json
      path: stderr
    - format: checkstyle
      path: report.xml
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
output:
  formats:
    json:
      path: stderr
    checkstyle:
      path: report.xml
```

</details>

#### `output.formats[].format: line-number`

This format has been replaced by the format `text`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
output:
  formats:
    - format: line-number
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
output:
  formats:
    text:
      path: stdout
```

</details>

#### `output.formats[].format: colored-line-number`

This format has been replaced by the format `text` with the option `colors` (`true` by default).

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
output:
  formats:
    - format: colored-line-number
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
output:
  formats:
    text:
      path: stdout
      colors: true
```

</details>

#### `output.formats[].format: colored-tab`

This format has been replaced by the format `tab` with the option `colors` (`true` by default).

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
output:
  formats:
    - format: colored-tab
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
output:
  formats:
    tab:
      path: stdout
      colors: true
```

</details>

#### `output.print-issued-lines`

This property has been removed.

To not print the lines with issues, use the `text` format with the option `print-issued-lines: false`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
output:
  formats:
    - format: line-number
      path: stdout
  print-issued-lines: false
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
output:
  formats:
    text:
      path: stdout
      print-issued-lines: false
```

</details>

#### `output.print-linter-name`

This property has been removed.

To not print the linter name, use the `text` format with the option `print-linter-name: false`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
output:
  formats:
    - format: line-number
      path: stdout
  print-linter-name: false
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
output:
  formats:
    text:
      path: stdout
      print-linter-name: false
```

</details>

#### `output.show-stats`

This property is `true` by default.

#### `output.sort-order`

This property has a new default value `['linter', 'file']` instead of `['file']`.

#### `output.sort-results`

The property has been removed.

The output results are always sorted.

#### `output.uniq-by-line`

This property has been deprecated since v1.63.0 and has been replaced by `issues.uniq-by-line`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
output:
  uniq-by-line: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
issues:
  uniq-by-line: true
```

</details>

### `run`

#### `run.go`

The new fallback value for this property is `1.22` instead of `1.17`.

#### `run.concurrency`

This property value set to match Linux container CPU quota by default and fallback on the number of logical CPUs in the machine.

#### `run.relative-path-mode`

This property has a new default value of `cfg` instead of `wd`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
run:
  # When not specified, relative-path-mode is set to 'wd' by default
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
run:
  relative-path-mode: 'cfg'
```

</details>

#### `run.show-stats`

This property has been deprecated since v1.57.0 and has been replaced by `output.show-stats`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
run:
  show-stats: true
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
output:
  show-stats: true
```

</details>

#### `run.skip-dirs-use-default`

This property has been deprecated since v1.57.0 and has been replaced by `issues.exclude-dirs-use-default`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
run:
  skip-dirs-use-default: false
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
issues:
  exclude-dirs-use-default: false
```

</details>

#### `run.skip-dirs`

This property has been deprecated since v1.57.0 and has been removed.

Use `linters.exclusions.paths` and `formatters.exclusions.paths` to exclude directories.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
run:
  skip-dirs:
    - src/external_libs
    - autogenerated_by_my_lib
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    paths:
      - src/external_libs
      - autogenerated_by_my_lib
```

</details>

#### `run.skip-files`

This property has been deprecated since v1.57.0 and has been removed.

Use `linters.exclusions.paths` and `formatters.exclusions.paths` to exclude files.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
run:
  skip-files:
    - '.*\.my\.go$'
    - lib/bad.go
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
linters:
  exclusions:
    paths:
      - '.*\.my\.go$'
      - lib/bad.go
```

</details>

#### `run.timeout`

This property value is disabled by default (`0`).

### `severity`

#### `severity.default-severity`

This property has been replaced with `severity.default`.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
severity:
  default-severity: error
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
severity:
  default: error
```

</details>

#### `severity.rules.case-sensitive`

`severity.rules.text` and `severity.rules.source` are case-sensitive by default.

To ignore case, use `(?i)` at the beginning of a regex syntax.

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```yaml
severity:
  case-sensitive: true
  rules:
    - severity: info
      linters:
        - foo
      text: 'Example.*'
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```yaml
severity:
  rules:
    - severity: info
      linters:
        - foo
      text: '(?i)Example.*'
```

</details>

### `version`

The `version` property has been added to the configuration file.

```yaml
version: "2"
```

### Integration

#### VSCode

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```json
"go.lintTool": "golangci-lint",
"go.lintFlags": [
  "--fast"
]
```

</details>

<details>
<summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```json
"go.lintTool": "golangci-lint",
"go.lintFlags": [
  "--fast-only"
],
"go.formatTool": "custom",
"go.alternateTools": {
  "customFormatter": "golangci-lint"
},
"go.formatFlags": [
  "fmt",
  "--stdin"
]
```

</details>

### Command Line Flags

The following flags have been removed:

- `--disable-all`
- `--enable-all`
- `-p, --presets`
- `--fast`
- `-e, --exclude`
- `--exclude-case-sensitive`
- `--exclude-dirs-use-default`
- `--exclude-dirs`
- `--exclude-files`
- `--exclude-generated`
- `--exclude-use-default`
- `--go string`
- `--sort-order`
- `--sort-results`
- `--out-format`
- `--print-issued-lines`
- `--print-linter-name`

#### `--out-format`

`--out-format` has been replaced with the following flags:

```bash
# Previously 'colored-line-number' and 'line-number'
--output.text.path
--output.text.print-linter-name
--output.text.print-issued-lines
--output.text.colors
```

```bash
# Previously 'json'
--output.json.path
```

```bash
# Previously 'colored-tab' and 'tab'
--output.tab.path
--output.tab.print-linter-name
--output.tab.colors
```

```bash
# Previously 'html'
--output.html.path
```

```bash
# Previously 'checkstyle'
--output.checkstyle.path
```

```bash
# Previously 'code-climate'
--output.code-climate.path
```

```bash
# Previously 'junit-xml' and 'junit-xml-extended'
--output.junit-xml.path
--output.junit-xml.extended
```

```bash
# Previously 'teamcity'
--output.teamcity.path
```

```bash
# Previously 'sarif'
--output.sarif.path
```

#### `--print-issued-lines`

`--print-issued-lines` has been replaced with `--output.text.print-issued-lines`.

#### `--print-linter-name`

`--print-linter-name` has been replaced with `--output.text.print-linter-name` or `--output.tab.print-linter-name`.

#### `--disable-all` and `--enable-all`

`--disable-all` has been replaced with `--default=none`.

`--enable-all` has been replaced with `--default=all`.

#### Examples

Run only the `govet` linter, output results to stdout in JSON format, and sort results:

<details>
  <summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```bash
golangci-lint run --disable-all --enable=govet --out-format=json --sort-order=linter --sort-results
```

</details>

<details>
  <summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```bash
golangci-lint run --default=none --enable=govet --output.json.path=stdout
```

</details>

Do not print issued lines, output results to stdout without colors in text format, and to `gl-code-quality-report.json` file in Code Climate's format:

<details>
  <summary style={{color: '#737380', paddingLeft: '1rem'}}>v1</summary>

```bash
golangci-lint run --print-issued-lines=false --out-format code-climate:gl-code-quality-report.json,line-number
```

</details>

<details>
  <summary style={{color: '#737380', paddingLeft: '1rem'}}>v2</summary>

```bash
golangci-lint run --output.text.path=stdout --output.text.colors=false --output.text.print-issued-lines=false --output.code-climate.path=gl-code-quality-report.json
```

</details>
