golint

`golangci-lint run` issue


I create a .golangci.yml in working directory, which have more linters than default, and run golangci-lint run -v but found linters are still default value, anyone encountered same issue? I have checked .golangci.yml path is correct. below is our configure value:

linters:
disable-all: true
enable:
  - bodyclose
  - deadcode
  - depguard
  - dogsled
  - dupl
  - errcheck
  - exhaustive
  - gochecknoinits
  - goconst
  - gocritic
  - gofmt
  - gomnd
  - goprintffuncname
  - gosec
  - gosimple
  - govet
  - ineffassign
  - interfacer
  - lll
  - misspell
  - nakedret
  - noctx

Solution

  • This yaml file isn't indented properly. try:

    linters:
      enable:
        - bodyclose
        - deadcode
        - depguard
        - dogsled
        - dupl
        - errcheck
        - exhaustive
        - gochecknoinits
        - goconst
        - gocritic
        - gofmt
        - gomnd
        - goprintffuncname
        - gosec
        - gosimple
        - govet
        - ineffassign
        - interfacer
        - lll
        - misspell
        - nakedret
        - noctx