x/pkgsite: report whether a subpackage is a command
What is the URL of the page with the issue?
https://pkg.go.dev/golang.org/x/perf, for example.
Screenshot
What did you expect to see?
Subpackage that are commands are reported as such with a command chip (similar to search results / package page).
What did you see instead?
Only modules are reported with a module chip.
I'm working on https://github.com/avamsi/gobin and would love this information! :) I currently don't process the subpackages (well, other than those that are inlined in the search results) but would love to, and if I'm not wrong, the only way to do this today is to hit the package pages for all the subpackages.
I think this falls under #36785 since it isn't intended for the page to be scraped.
This will arguably help humans in disambiguating packages as well (consider golang.org/x/perf/benchstat vs golang.org/x/perf/cmd/benchstat from above, for example -- although I guess cmd/ is hint enough here).
FWIW, I was going through the code and this might be as simple as adding a new IsCommand field with pm.Name == "main" here (and using it here to render the command chip)?
cc: @jba
Change https://go.dev/cl/620739 mentions this issue: internal/frontend: report whether subdirectories are commands