Replies: 1 comment
-
Hi! Very implicit behavior of golangci-lint, did you investigate what is code do this and why? 🤔 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Team,
I'm building a new analyzer where I need to scan the source files of the package being analyzed. However, when golangci-lint is calling my analyzer, the analysis.Pass.Fset being passed contains way more files, also from Go's stdlib. The analysis.Pass.Files are only the ones of the package.
Now I can't seem to find a way to tell which of the files in Pass.Fset belong to the package being analyzed and which don't. Please note that I need to read the actual source files, I can't use their ASTs here.
For now I'm running "go env GOROOT/GOCACHE/GOMODCACHE" to get Go's default paths and filter out some of the files. This helps somewhat, but I'm still getting files from other parts of the module that don't belong to the package currently being analyzed. I feel there should be a better way overall.
It would be best if I just had a way to get the filesystem path of the current package being analyzed.
Any help would be appreciated. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions