From bafefe4942ffd06707ef9bb0774f6d91ad138a15 Mon Sep 17 00:00:00 2001 From: Zeal Wierslee Date: Thu, 11 Mar 2021 10:19:20 -0800 Subject: [PATCH] Add `go mod init` to quick-start Updated documentation to make it clear that a `go.mod` file is required to run `golangci-lint` --- docs/src/docs/usage/faq.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/src/docs/usage/faq.mdx b/docs/src/docs/usage/faq.mdx index 248f3a33f95f..c9de1942ccc3 100644 --- a/docs/src/docs/usage/faq.mdx +++ b/docs/src/docs/usage/faq.mdx @@ -40,3 +40,9 @@ Long answer: Because the first run caches type information. All subsequent runs will be fast. Usually this options is used during development on local machine and compilation was already performed. + +## How does `golangci-lint` find go source files? + +`golangci-lint` uses go modules to find golang files. If your project is a go module, it should *just work*. + +If your project is not a go module, you can still use `golangci-lint` for your project. You can do this by setting the environment variable `GO111MODULE=off` when you run `golangci-lint`. Make sure you set this in your CI toolchain appropriately.