简体   繁体   English

`golangci-lint run` 问题

[英]`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?我在工作目录中创建了一个.golangci.yml ,它的linters比默认的多,然后运行golangci-lint run -v但发现 linters 仍然是默认值,有人遇到过同样的问题吗? I have checked .golangci.yml path is correct.我检查过.golangci.yml路径是否正确。 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

This yaml file isn't indented properly.这个 yaml 文件没有正确缩进。 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM