-
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: mod edit doesn't respect direct/indirect blocks in go.mod #51983
Comments
Interesting. When I
before the Update When I
to before So question is why |
Notice that #52296 has a flow to produce a |
Ah, yes, I noticed that as well; looks like a bug |
That seems like a different issue than the one originally reported here |
@seankhliao I think that‘s actually the root cause of this issue as it creates the impure section. #52296 is about module graph evaluation but it does accidentally show how to create an impure section which I wasn‘t able to reproduce otherwise (and hence closed the issue). With the repro it should be possible to fix the root cause. |
@andig, could you summarize the repro steps here? (But, to set expectations: if they involve |
It is indeed caused by
|
@bcmills That being said, it would be nice if |
@andig, we've rewritten the direct-organizing logic at least twice now to try to fix the heuristic. (It intentionally doesn't mess with existing block structure, in case projects have their own block structure they're trying to maintain.) I think the only viable improvement would be to give up on maintaining existing structure entirely. That would need a full proposal (since it would be a visible change in behavior), but even then there are all kinds of thorny issues around comment handling that I really don't have the bandwidth to address. 😩 |
No problem. Then let‘s just close this issue? +1 for the „unfortunate“ label :) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Repo at evcc-io/evcc@6f2abf4:
go.mod
requires 1.17 at this point.What did you expect to see?
Single
require
section.What did you see instead?
2nd require section is added in
go.mod
:Replacing
with
in the code and running
does not remove the 2nd require section.
UPDATE I think the root cause of
is in #51983 (comment).
The text was updated successfully, but these errors were encountered: