How to run linter on code that depends on packages outside the analyzed elements. #4818
Unanswered
harshit2202
asked this question in
Q&A
Replies: 1 comment 4 replies
-
hello, a You need to run golangci-lint inside a module (ex: the directory |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to run linter on one module(let's name this
module-1
) in our mono-repo setup, which depends on another module(module-2
). And it is failing stating typecheck error for all the imports that are from the module-2 in module-1.On investigating this I found that this is already mentioned in the https://golangci-lint.run/welcome/faq/#why-do-you-have-typecheck-errors
Ensure you are not running an analysis on code that depends on files/packages outside the scope of the analyzed elements.
Is there any workaround for this? I would appreciate any help.
Current file structure is
In the
module-1/go.mod
, we import the dependencymodule-2
usingreplace github.com/main-github-repo-/module-1 v1.0.0 => ../module-1
Beta Was this translation helpful? Give feedback.
All reactions