nametake / golangci-lint-langserver

golangci-lint language server
MIT License
201 stars 19 forks source link

v0.0.8 breaks when `go.mod` is not in repo root #33

Open thejan2009 opened 1 year ago

thejan2009 commented 1 year ago

The issue was introduced with #25. Cmd breaks when the go.mod is located in a subpath. Example structure:

project
├── .git
└── go
    ├── go.mod
    └── main.go

One way to solve this would be finding the go mod root. go env GOMOD returns the correct value or os.DevNull if if can't find one.

thejan2009 commented 1 year ago

I opened a fix PR in golangci-lint https://github.com/golangci/golangci-lint/pull/3748 and propose the changes from v0.0.8 are partially reverted.