bazelbuild / rules_go

Go rules for Bazel
Apache License 2.0
1.35k stars 635 forks source link

Rework gopackagedriver to use driver protocol from x/tools #3962

Open sluongng opened 1 week ago

sluongng commented 1 week ago

There is now an official documentation for the Package driver protocol via x/tools https://pkg.go.dev/golang.org/x/tools/go/packages#hdr-The_driver_protocol

This is what gopls will be built upon, and we should consider migrating there to have better compatibility with gopls in the future.

Worth noting that our package driver could now be used to power tools other than gopls. This includes golangci-lint or other linters in the same category. In the future, we should also aim to support official Go tools such as govulncheck via a proper package driver.