We have proto files that import "google/api/annotations.proto";. I'm adding # gazelle:resolve proto go google/api/annotations.proto @org_golang_google_genproto//googleapis/api/annotations to some BUILD files but gazelle is still adding "@go_googleapis//google/api:annotations_go_proto" as a dep to go_library rules.
How do I find out why gazelle is doing that?
As per the docs for directives: https://github.com/bazelbuild/bazel-gazelle#directives
Since you have your import-lang set to
go, Its picking up the name of the rule defining thego_proto_libraryin the repo:https://github.com/googleapis/googleapis/blob/9f7c0ffdaa8ceb2f27982bad713a03306157a4d2/google/api/BUILD.bazel#L345