Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Monorepo in Goland: Running error: context loading failed #162

Open
kelzenberg opened this issue Aug 2, 2024 · 2 comments
Open

Monorepo in Goland: Running error: context loading failed #162

kelzenberg opened this issue Aug 2, 2024 · 2 comments

Comments

@kelzenberg
Copy link

kelzenberg commented Aug 2, 2024

I have a monorepo with several projects, some Go, some other languages.
Each Go project includes its own go.mod and a .golangci.yaml and I assumed that the linter plugin would respect these when I uncheck "Project Root" in the config (as described in the Readme).

Unfortunately I still get errors every time I save a file.

/opt/homebrew/bin/golangci-lint run --disable=typecheck /Users/xxx/Developer/foo/project-a/internal
level=error msg="Running error: context loading failed: no go files to analyze: running `go mod tidy` may solve the problem"

I checked this issue but couldn't find an answer regarding monorepos like mine.

I believe it has something to do with the file watcher as this errors persists even after deactivating the plugin.
Any assistance debugging this is much appreciated.

Goland log:

2024-07-31 10:46:58,585 [  34452]   WARN - go-linter - Run error: level=error msg="Running error: context loading failed: no go files to analyze: running `go mod tidy` may solve the problem"
. Please make sure the project has no syntax error.
2024-07-31 10:46:58,586 [  34453]   WARN - go-linter - Debug command: cd '/Users/xxx/Developer/foo' && export PATH='/Users/xxx/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.5.darwin-arm64/bin:/usr/bin:/bin:/usr/sbin:/sbin' && export GOPATH='' && export GO111MODULE='on' && '/opt/homebrew/bin/golangci-lint' 'run' '--out-format' 'json' '--allow-parallel-runners' '-j' '8' '--issues-exit-code' '1' '--max-issues-per-linter' '0' '--max-same-issues' '0' '--no-config' '--disable-all' '-E' 'staticcheck,govet,errcheck,ineffassign,unused,gosimple' 'project-a/cmd'

GoLand 2024.1.4
Build #GO-241.18034.61, built on June 20, 2024
Runtime version: 17.0.11+1-b1207.24 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.5

@sergunya
Copy link

sergunya commented Oct 9, 2024

Hi!

As you may have already read on the main page of this project, the GoLand team will take care of the plugin and its further development from now on. For convenience and consistency, we have moved all open tickets for this plugin from GitHub to the open bug tracker of the GoLand product (here is a link to this ticket).

We will soon analyze all the issues and plan to work on them. Feel free to open a new ticket or leave comments on existing ones.

@kelzenberg
Copy link
Author

kelzenberg commented Oct 9, 2024

Hey!
I wasn't sure from the comment on the README how far these talks have progressed yet but good to hear that there's ownership and a game plan. Let me know, once you've analysed the issues, if you need more details. Looking forward to the official integration 🙌

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants