golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123k stars 17.54k forks source link

x/tools/gopls: show errors on all files with import cycles #52904

Open findleyr opened 2 years ago

findleyr commented 2 years ago

Investigating failures of gopls/internal/regtest/diagnostics.TestResolveImportCycles with @matloob, we discovered that gopls is not locating import cycle errors on all packages involved in an import cycle.

In go list json output, the Error field is only set for one package, but the rest can be inferred from the cycle information.

gopherbot commented 2 years ago

Change https://go.dev/cl/406274 mentions this issue: internal/lsp/regtest: make TestResolveImportCycle robust to error order