go - `golangci-lint 运行`问题
问题描述
.golangci.yml
我在工作目录中创建了一个linters
超过默认值的目录,然后运行golangci-lint run -v
但发现 linter 仍然是默认值,有人遇到过同样的问题吗?我检查了.golangci.yml
路径是否正确。下面是我们的配置值:
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
解决方案
此 yaml 文件未正确缩进。尝试:
linters:
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- exhaustive
- gochecknoinits
- goconst
- gocritic
- gofmt
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
- nakedret
- noctx
推荐阅读
- android - 我想要没有 MAIN 片段或按钮的条件登录导航
- postgresql - PostgreSQL 的统计收集器是否跟踪索引的*所有*使用情况?
- android - Kotlin android开发diffutil itemCallback类型错误
- neovim - 无法获取目录:“/home/myname/.config/nvim/init.vim”
- python - 输出 .dot 文件未在文件夹中创建。为什么?怎么修?
- c# - 如何在不检查空值的情况下编写 IEqualityComparer?
- python - 如何让我的 docker 文件复制 requirements.txt 并正确公开端口
- html - 使用 :: before 设置边框
- azure-devops - 使用 MSAL 对 ADO Rest API 进行身份验证返回未找到
- flutter - 如何摆脱抖动中资产图像的加载时间