-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Make go install
work consistently for every project
#69733
Comments
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
see |
@seankhliao Doesn't work for github.com/trufflesecurity/trufflehog@latest > go install github.com/trufflesecurity/trufflehog@latest
go: github.com/trufflesecurity/trufflehog@latest: module github.com/trufflesecurity/trufflehog@latest found (v3.0.0-rc3+incompatible), but does not contain package github.com/trufflesecurity/trufflehog |
That's intentional, major versions are considered different modules, we would not blur the line between them. |
@seankhliao But what's the proper |
It is Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only. For questions please refer to https://github.com/golang/go/wiki/Questions |
@seankhliao That hasn't been my experience. Caution
Which is the problem I'm describing. Important
How about simply pointing to the root of a repo. For example, Proposal: An Official Go Package ManagerGo needs an official package manager. Rust has Common Features of a Modern Package ManagerManifest file
Common set of commands
RecapWhat I'm proposing is that you should only have to type Specifically, you should not have to:
|
Go version
go 1.23
Output of
go env
in your module/workspace:What did you do?
Sometimes it's
go install github.com/hello/world@latest
, orgo install github.com/hello/world/cmd/other@latest
orgo install github.com/hello/world/v3@latest
or it just doesn't work.What did you see happen?
Often fails.
What did you expect to see?
Should install the program(s).
Proposal: An Official Go Package Manager
Go needs an official package manager. Rust has
cargo
. Node hasnpm
. Just about every cool new language has it's own package manager and package repository.Common Features of a Modern Package Manager
Manifest file
Common set of commands
go mod init
should bego init
]Recap
What I'm proposing is that you should only have to type
go install github.com/owner/project
and everything should automatically work.Specifically, you should not have to:
/cmd/<some command that's not necessarily "project">
@latest
or@<some semver>
Let's create an official package manifest file format that
go install
can use to find and compile projects.It would allow putting code in
cmd
,src
, or any other directory, and will proactively search the root directory and./cmd/<module name specified at the top of go.mod>
.The text was updated successfully, but these errors were encountered: