How to ignore test files(_test.go) using go/analysis?

855 Views Asked by At

How to ignore test files(_test.go) using go/analysis? It seems like that go/analysis load test files by default.

2

There are 2 best solutions below

0
On

Singlechecker assumes tests are enabled by default and -test=false disables them.

1
On

This was mentioned in Oct. 2020 with golang/go issue 41771:

It was discussed in leighmcculloch/gochecknoglobals PR 16, but so far (Sept. 2021), without any clear resolution.