Both the go_test and go_benchmark rule produce two hidden go_library targets.
_{name}#lib and _{name}#main_lib.
Both rules also explicitly call _go_pkg_info to produce a pkg_info target for the rule.
The go_test rule includes the _generate_pkg_info = False argument on the hidden go_library targets to prevent them from producing any associated pkg_info targets. This ensures that it only produces on pkginfo target.
The go_benchmark rule does not do this and so it produces three independent pkginfo targets for the same sources.
All three packages are included in the response when calling the gopackagesdriver.
Both the
go_testandgo_benchmarkrule produce two hiddengo_librarytargets._{name}#liband_{name}#main_lib.Both rules also explicitly call
_go_pkg_infoto produce apkg_infotarget for the rule.The
go_testrule includes the_generate_pkg_info = Falseargument on the hiddengo_librarytargets to prevent them from producing any associatedpkg_infotargets. This ensures that it only produces onpkginfotarget.The
go_benchmarkrule does not do this and so it produces three independentpkginfotargets for the same sources.All three packages are included in the response when calling the gopackagesdriver.