【问题标题】:How to ignore test files(_test.go) using go/analysis?如何使用 go/analysis 忽略测试文件(_test.go)?
【发布时间】:2021-11-20 17:24:55
【问题描述】:

如何使用 go/analysis 忽略测试文件(_test.go)?似乎 go/analysis 默认会加载测试文件。

【问题讨论】:

  • 显示加载文件进行分析的代码。
  • 我使用func main() { singlechecker.Main(diggen.Analyzer) } 运行分析器。

标签: go golint


【解决方案1】:

这是在 2020 年 10 月通过golang/go issue 41771 提到的:

leighmcculloch/gochecknoglobals PR 16 中讨论过,但到目前为止(2021 年 9 月),没有任何明确的解决方案。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2019-11-16
  • 1970-01-01
  • 2019-09-30
  • 1970-01-01
  • 2017-05-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多