Is there a workaround/known issue with `golangci_l...
# general
l
Is there a workaround/known issue with
golangci_lint
? When I run it against a pretty basic setup I get an error saying:
Copy code
15:52:31.72 [ERROR] Completed: Lint with golangci-lint - golangci-lint failed (exit code 7).
level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"
My layout is a standard Go project layout, it looks like the following:
Copy code
.
├── conf
├── dist
└── src
    ├── docker
    │   └── projA
    ├── go
    │   ├── cmd
    │   │   ├── binA
    │   │   └── binB
    │   └── pkg
    │       └── projA
    │           └── testfiles
    └── python
        └── projC
It looks like this is maybe related to Go workspaces (https://github.com/golangci/golangci-lint/issues/2654), but I’m not using them (single go.mod in src/go). Anyone else run into this?
b
There was a recent batch of fixes https://github.com/pantsbuild/pants/pull/19015 for that (currently only in the
main
branch, not any releases, yet). Does that look like it might be resolving your issue?
f
Or maybe golangci_lint needs the entire module available to it in the sandbox when it runs?