-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: cmd/go: add package search functionality #33203
Comments
I don't think this needs to be a Go2 proposal: it's not a language change, and it could be a |
@ALTree I disagree.
To check if it's installed and the path it's located at.
To check version history and changelog of the package
To list all imports along with their version used in that package
To list all open or closed reported issues for the package on the package's repository We could also have control over what info we want for the package
And many more possibilities that the community would bring |
It's a little unclear to me what the use-case for this is. Is this meant to be a tool for discovery of packages? Or just a quick way to see version numbers and metadata? Go packages can be hosted anywhere (not just GitHub), so it wouldn't always be possible to query metrics like "bugs" or "downloads". In fact, even for GitHub repositories, I'm not sure getting those metrics is really feasible. Open issues on GitHub are not always bugs, and I don't think the public can see metrics for a repo's clone counts. I also think in general Go should steer away from GitHub-specific integrations.
"Why not" isn't really the question we should be asking when considering new features. If there's not a compelling reason for a feature, it shouldn't be added. I'm personally not necessarily against a CLI search tool; this proposal as-is just doesn't seem very compelling to me. |
@ccbrown Agreed. This is a proposal which is the first step in the chain of improvements and iterations for having a debate on integrating search functionality and making some central package management which we can rely on as a community. I know metrics like "bugs" and "downloads" and "changelog" are not possible to track (or with precision) with Github or any other package hosting service like Gitlab. This is a proposal to bring this problem to light and that we need a better way for package discovery along with their metadata in Go with CLI. I am changing "github.com" link in my suggestion to "hosted.site.com" You are welcome to make your suggestions and improvements. |
https://index.golang.org/ is something to that effect. |
@julieqiu is working on a new site for searching and discovering modules and packages. I'm not sure if they're planning on exposing an API that a command line tool could access. We've talked about having That said, I'm not convinced this belongs in the go tool, which should remain focused on building and testing. The go tool also has a very rigid release cycle and dependency restrictions. A standalone tool would be more flexible. |
Good point, the go tool should remain focused on building and testing. Updating in the proposal |
The output shown in the top comment is not in scope for either the go command or goimports; neither would have any idea about "bug count" for example. The discovery site (or for now godoc.org) is the mechanism for collecting and displaying that kind of information. We should probably focus on that and not command-line tools. |
Then why not new tool, something like
Okay, excluding "bug count"
Exactly. And it is tedious.
Why not command-line tool for search? I'm sure you've used all of the following It makes search fast and easy. @rsc Why not in Go ? |
Every single one of those has a central package database, though. Go does not. That being said, I don't think it would be too weird to have an optional feature for whatever module proxy server your system is using to enable search, and have it implemented for the default server. I also think it makes more sense to integrate this into |
Talking about non-centralized package management, found some tools online for decentralized package management in Go The pioneer’s guide to GX — decentralized dependency management on IPFS |
The discovery site / godoc.org is still the place where this information should live. Maybe some day there might be a command-line interface to query it, but we are still standing up the new site. In any event, the search functionality would not be in cmd/go itself. Go list itself is also already too overloaded. I suggest we decline this. Any objections? |
I'll go ahead and close this. Having this in a separate tool, possibly integrated with the discovery site or godoc.org is a good plan. |
For updates on the status of the discovery site, see #33654. |
https://search.gocenter.io can be used to discover go modules. |
Hi Go Community,
This is proposal for adding functionality of package search in go toolchain.
How it would work?
This would be handy and also a step towards better package management support in Go 2.
We already have web search interface for this sort of thing
https://go-search.org/
https://godoc.org/
Why not at the command line ?
-- UPDATE --
As discussed below with @jayconrod , it makes more sense to leave the search functionality for
goimports
than thego
tool which should remain focused on building and testing.So we'd
goimports search logrus
The text was updated successfully, but these errors were encountered: