bazel-contrib / rules_go

Go rules for Bazel
Apache License 2.0
1.39k stars 664 forks source link

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

Open sluongng opened 5 months ago

sluongng commented 5 months 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.

ellie-idb commented 4 days ago

I've made this change in our internal fork of gopackagesdriver. Currently waiting on approval to open-source it and contribute it back :)