-
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
cmd/go: consolidate similar hint commands printed with errors #43653
Comments
Hi @jayconrod , I think I am experiencing a similar issue that I thought I'd add here (let me know if it's different and I'm happy to open a new issue). The issue happens with Facebook's ent library: github.com/facebook/ent The library (similar to protobufs and twirp) has a code generator and also is expected to be imported directly and therefore it's a best practice to make sure the code generator and the library are both always the same version. Therefore, the library recommends that instead of installing the binary and running it like so In Go 1.15, things worked fine. But in 1.16 I get the following error:
I have created a repro with a readme here: here https://github.com/marwan-at-work/enterr Of course, we can also pass Thanks! |
Thanks @marwan-at-work, I think this is the same issue viewed from another angle. I think the best thing to recommend here is to define a dummy package that imports tools (#25922), then I don't think the
|
Change https://golang.org/cl/298650 mentions this issue: |
In Go 1.16, the
go
command will suggest commands the user can run to fix common errors ingo.mod
andgo.sum
like missing requirements and sums. These hints are important, since a few errors will become a lot more common with-mod=readonly
enabled by default (#40728); previously, these errors were fixed automatically bygo build
,go list
, and other commands.In some cases, different variations of the same hint may be printed several times. For example, the project below has a
go.sum
file with some missing sums.The command
go build .
prints the two errors below:When there are similar errors like this, we should try to consolidate them. In this case, we should print something like:
cc @bcmills @matloob
The text was updated successfully, but these errors were encountered: